Uninstall Problem with Greenshot - Advanced Installer Community
j.schulz
Posts: 2
Joined: Fri Aug 10, 2018 2:16 pm

Uninstall Problem with Greenshot

Hi,

i am currently building packages for MS AutoPilot and i have a problem with Greenshot.
I created a project and added the Greenshot Installer a Post-Install with silent Parameter.

Install works fine, my project is not registered with Windows Installer because i don't want
to have double entries (Uninstall from EXE Installer, and Windows Installer entry).

If so i have the problem that it's not possible to uninstall via the msi package i create, therefore
i added to register with windows installer and added the uninstall command line:
"%programfiles%\Greenshot\unins000.exe" /SILENT

When i now uninstall Greenshot by the Windows Installer entry, Greenshot will be removed so my
commandline is working but right afterwards it will be installed again.

I am sure the installer is driving through the post-install even when i uninstall the msi but why? when i tick uninstall why would
it post-install again? Curious, what i am missing?

Image


Regards Jens
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Uninstall Problem with Greenshot

Hello Jens,

First of all, sorry for my delayed reply.

Indeed, I have tested your scenario and I you are right, the issue reproduced on my side as well. This happens because that option actually launches the prerequisite installer with the command lines specified in the "Uninstall using this command line:" option. In your case, the uninstaller path is added as a command line parameter to the prerequisite installer (the one specified in the "File Path", under "Main Setup File").

The whole prerequisite uninstall option can be translated into a command line as it follows:

Code: Select all

"C:\users\schulz\Desktop\Install\Greenshot-INSTALLER-1.2.10.6-RELEASE.exe" "%programfiles%\Greenshot\unins000.exe" /SILENT
Indeed, this is an Advanced Installer limitation.

As a workaround, you can use a PowerShell script custom action which will launch the uninstaller (unins000.exe) after the uninstallation process of your main package. Here is a step by step which will help you implement those said above:

1) First, go to "Prerequisites" page --> under "Setup Files" tab --> uncheck the "Uninstall using this command line:" option.

2) Now go to "Custom Actions" page --> from the list, select the "Run PowerShell inline script" and click the "Add custom action without sequence" (this button is placed to the right side of the custom action name).

3) Now drag and drop the custom action after "Finish Execution" action group (because we want it to execute after the uninstallation process of the main package)

4) The script which launches the "unins000.exe" can be as follows:

Code: Select all

cd 'C:\Program Files\Greenshot\'
.\unins000.exe /SILENT
5) Under "Execution Options", uncheck the "Wait for custom action to finish before proceeding" and "Fail installation if custom action returns an error" options.

6) Under "Execution Stage Condition", uncheck the "Install" and "Maintenance" options, so our script will only run on uninstalls. Also, the condition from the "Condition" field should look as it follows:

Code: Select all

(VersionNT > 501) OR (VersionNT = 501 AND ServicePackLevel >= 2)
Let me know if this helps!

Kind regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”