Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mods on WAU.msi install #725

Merged
merged 3 commits into from
Sep 30, 2024
Merged

Add mods on WAU.msi install #725

merged 3 commits into from
Sep 30, 2024

Conversation

Romanitho
Copy link
Owner

Proposed Changes

  • Same as included/excluded_app.txt, mods can be placed in the source location:

image

The mods will get copied during installation.

Copy link
Contributor

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
⚠️ COPYPASTE jscpd yes 2 1.96s
✅ POWERSHELL powershell 2 0 4.79s
✅ POWERSHELL powershell_formatter 2 0 3.62s
⚠️ REPOSITORY checkov yes 2 13.68s
⚠️ REPOSITORY devskim yes 2 1.84s
✅ REPOSITORY dustilock yes no 0.01s
✅ REPOSITORY gitleaks yes no 0.94s
✅ REPOSITORY git_diff yes no 0.02s
✅ REPOSITORY grype yes no 13.74s
✅ REPOSITORY kics yes no 1.87s
✅ REPOSITORY secretlint yes no 0.8s
✅ REPOSITORY syft yes no 0.47s
✅ REPOSITORY trivy yes no 5.97s
✅ REPOSITORY trivy-sbom yes no 0.92s
⚠️ REPOSITORY trufflehog yes 1 4.04s
⚠️ SPELL cspell 3 11 3.45s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@Romanitho
Copy link
Owner Author

@KnifMelti for first install. Don't know if it can help. I was thinking of SCCM or Autopilot scenarios.

@Romanitho Romanitho merged commit fb6ebdc into main Sep 30, 2024
1 check passed
@Romanitho Romanitho deleted the mods branch September 30, 2024 22:33
@KnifMelti
Copy link
Contributor

KnifMelti commented Oct 1, 2024

No -Force in copy?
Good you delete mods on uninstall! (EDIT: Ah, on install not upgrade. On uninstall?)

@Romanitho
Copy link
Owner Author

We can use "-force" to overwrite. Perhaps it's a good idea.
On upgrade, if you want to push new mods, you're right. I'll take a closer look at that. 😅

@Romanitho
Copy link
Owner Author

Romanitho commented Oct 1, 2024

I made new tests on my WSB:

  • Installed msi 1.21.1
  • put custom mods in Mods WAU's location
  • enabled prerelease in regedit
  • run WAU
  • Custom mods still there after upgrade to 1.22.2-n ✅
  • Installed msi 1.21.1
  • put custom mods in Mods WAU's location
  • installed msi 1.22.2-n manually
  • Custom mods still there after upgrade ✅
  • Installed msi 1.21.1
  • put custom mods in Mods WAU's location
  • installed msi 1.22.2-n with Mods in root msi location
  • Custom mods still there after upgrade and the ones in 1.22.2-n replaced the 1.21.1 ones ✅
  • Uninstalled 1.22.2-n
  • Everything removed ✅

For me, expected behavior is observed. But I've already got strange things on WSB in the past.

@KnifMelti
Copy link
Contributor

Im running Proxmox with a full Win11 as major test machine with rollback to snapshot afterwards, WSB for fast testing.
I'm in bed sick now so I'm not testing this 😉

@KnifMelti
Copy link
Contributor

GitHub Copilot says:

The selected line in the code is:

Copy-Item -Path $ModsFolder -Destination "$InstallPath" -Recurse

Even though the -Force parameter is not explicitly used, the destination can still be overwritten because of how Copy-Item operates in PowerShell. By default, Copy-Item will overwrite existing files in the destination if they have the same name as the source files. The -Recurse parameter ensures that all items and child items in the source directory are copied to the destination, which includes overwriting files if they already exist in the destination directory.

@Romanitho
Copy link
Owner Author

so, that's perfect, no? :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants