Hi,
For what you need you can try these steps:
- in the
Search page create a new search
- add for it this registry location:
Code: Select all
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<ProductCode>\InstallLocation
- where you replace
"<ProductCode>" with the Product Code of the old version
- the property (name) of this search will contain its result (the path of the old installation), so you should set it to something meaningful, for example OLD_INSTALL_PATH
- in the
Custom Actions page create a new
"Property set with formatted" custom action under
"InstallUISequence" -> "Begin"
- while the SHIFT key is pressed, drag the custom action over
"InstallExecuteSequence" -> "Begin"
- for this custom action set the "Property Name" field of the "Custom Action Properties" pane to APPDIR (the property which contains the installation path)
- set the "Formatted Text" field to the property of the search (OLD_INSTALL_PATH)
- set the condition of the custom action to
"(Not Installed)"
- in the "Dialogs" page remove the "FolderDlg" dialog so the user cannot change the installation path
Please note that you can see the "Begin" standard action by using the "Show Standard Action" button on the toolbar of the "Custom Actions" page. The registry value used for this approach is the one created automatically by Windows Installer. For future versions of your product you should make sure that you create your own registry value with the installation path.
Regards,
Cosmin
FOLLOW US
Get the latest news in Application Packaging