Hello Mindaugas,
Indeed, the
"Uninstall previous versions" custom action can not be used during the
"Install Execution Stage".
This custom action is mainly used when you want your setup to uninstall an older setup which has a different install type. In your case, your installation type is of "Per-user" and your old installation is probably of "Per-machine" type.
However, after investigating this a bit more, I have come up with a workaround which will not have you changing the installation type of your package --> which will further lead in you being able to upgrade silently.
The workaround is as it follows: we will create a property based folder which will resolve to the following location:
[%UserProfile]\Desktop
The %userprofile% environment variable resolves to the following location:
C:\Users\<username>.
After doing so, we will redirect our shortcut to the earlier created property based folder.
Here are the steps which you can follow in order to achieve this:
1. please go to
"Install Parameters" page and create the following property:
Name: USER_DESKTOP
Value: null
(the property name can be changed)
2. now please go to
"Custom Actions" page and add a
"SetProperty" custom action
with sequence. In order to add a custom action with sequence, simply press the
"Add custom action with sequence" button which is placed to the right side of the custom action's name.
The property must be scheduled between the
"Searches" and
"Paths Resolution" action groups and it could look like it follows:
Property: USER_DESKTOP
Value: [%UserProfile]\Desktop
Execution Time: Immediately
Uncheck the
"Uninstall" and
"Maintenance" options from under the
"Dialogs Stage Condition"
This custom action should be shared between the two execution stages (Wizard Dialogs Stage and Install Execution Stage), in order for it to also execute during a silent installation. In order to share a property, all you have to do is to hold
SHIFT + drag and drop the custom action under the
"Install Execution Stage"
Please find attached a SetProperty custom action screenshot for your reference:
- Capture.PNG (49.59 KiB) Viewed 5732 times
3. now the last step is to create the property based folder and redirect the shortcut to it. Here is how you can proceed:
- please go to
"Files and Folders" page
- right click on the
"Application Folder" -->
"New Folder" -->
"Property Based" --> choose the earlier created property (USER_DESKTOP)
- now please redirect the shortcut to the earlier added property based folder - click on the .EXE file -->
"New Shortcut To" button from the toolbar -->
"Installed File" --> click on the
"..." button that is located to the right side of the
"Shortcut folder:" field --> choose the earlier created property based folder.
Now the shortcut will be created under the user's desktop folder and you should be able to successfully proceed in upgrading your product silently.
Hope this helps.
All the best,
Catalin