We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When fixing #430 , I've noticed that the installer script uses Add-AppxProvisionedPackage to install the app, which adds an app package (.appx) that will install for each new user to a Windows image, and caused some problems:
Add-AppxProvisionedPackage
So I'm wondering if it's better to use Add-AppxPackage to install for current user without a permission request
Add-AppxPackage
{ "installer": { "script": [ "$ProgressPreference = \"SilentlyContinue\"", "Add-AppxPackage -Path \"$dir\\Notepads.msixbundle\"" ] } }
And for persist folders, mounting with junction may helps backing up files in real time
{ "post_install": [ "$package_dir = Resolve-Path -Path \"$env:LOCALAPPDATA\\Packages\\*JackieLiu*Notepads*\" | Select-Object -ExpandProperty Path", "if (-not (Test-Path -Path \"$persist_dir\\LocalAppData\")) {", " New-Item -Path \"$persist_dir\\LocalAppData\" -ItemType Directory -Force | Out-Null", " Get-ChildItem \"$package_dir\" | Copy-Item -Destination \"$persist_dir\\LocalAppData\" -Force -Recurse", "}", "Remove-Item \"$package_dir\" -Force -Recurse", "New-Item -ItemType Junction -Path \"$package_dir\" -Target \"$persist_dir\\LocalAppData\" -Force | Out-Null" ] }
It's also recommended to ask for confirmation before Stop-Process
Stop-Process
{ "uninstaller": { "script": [ "$ProgressPreference = \"SilentlyContinue\"", "$is_running = $null -ne $(Get-Process -Name Notepads -ErrorAction SilentlyContinue)", "if ($is_running) {", " Write-Host \"`nNotepads is running, would you like to continue?\" -ForegroundColor Yellow", " $answer = Read-Host -Prompt \"Enter 'y' to continue, any other key to cancel\"", " if ('y' -eq $answer) {", " Write-Host \"Stopping process...\" -ForegroundColor Yellow -NoNewline", " Stop-Process -Name Notepads -ErrorAction Stop", " Start-Sleep -Milliseconds 250", " } else {", " Write-Host \"Uninstallation cancelled.\" -ForegroundColor Red", " break", " }", "}", "Get-AppxPackage -Name '*JackieLiu*Notepads*' | Remove-AppxPackage -PreserveRoamableApplicationData -ErrorAction Stop", "Resolve-Path -Path \"$env:LOCALAPPDATA\\Packages\\*JackieLiu*Notepads*\" | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue" ] } }
I have tested the modified manifest, it works well and never stuck in post_install script, even without the patch in #431 .
post_install
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When fixing #430 , I've noticed that the installer script uses
Add-AppxProvisionedPackage
to install the app, which adds an app package (.appx) that will install for each new user to a Windows image, and caused some problems:So I'm wondering if it's better to use
Add-AppxPackage
to install for current user without a permission requestAnd for persist folders, mounting with junction may helps backing up files in real time
It's also recommended to ask for confirmation before
Stop-Process
I have tested the modified manifest, it works well and never stuck in
post_install
script, even without the patch in #431 .The text was updated successfully, but these errors were encountered: