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

(inkscape) removes msi before upgrade to prevent 1638 error, fixes #550 #996

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions automatic/inkscape/tools/chocolateybeforemodify.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$app = Get-WmiObject -Class Win32_Product -Filter "Name Like 'Inkscape%'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use the Get-WmiObject, but rather use a combination of Get-UninstallRegistryKey and Uninstall-ChocolateyPackage instead.

If you could update with that, I would be more than happy to merge this one in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also forgot, this must be done in the install script, not the before modify script (Since the before modify script is run on both upgrade and uninstall, but doesn't fail the package if it doesn't work))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdmiringWorm I tried that before but ran into problems. I've spent enough time on this so I encourage someone else to have a go at this.


if ($app) {
Write-Host "Inkscape already installed. Removing..."
$app.Uninstall()
Write-Host "Done. Continuing with update/uninstall..."
}