Change user UI based on previous installation - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

WillemH
Posts: 6
Joined: Fri Sep 12, 2008 10:48 am

Change user UI based on previous installation

I wonder if this behaviour could be accomplished :

I have a installation that always runs in 'Major Upgrade' mode. I.e. Is application is already installed, it will uninstall that one,
and installs the new version. If not installed, just install the new one.

Now what I would like : If the application is already installed (based on upgrade code, like upgrades work), I want to get the
installation path from the already installed version, set APPDIR to that value and also, if possible, remove the FolderDlg from
the Installsequence (Or at least 'disable' the possibility to change the APPDIR). Would this be possible, if so, how to do it.

Thanks in advance for any hints / tips where to look.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Change user UI based on previous installation

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
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”