Upgrading an install for all users

Need help authoring your installer? Ask the community for tips and advice.
sstrader
Posts: 2
Joined: Mon Dec 04, 2017 1:50 pm

Upgrading an install for all users

Postby sstrader » Mon Dec 04, 2017 2:32 pm

I'm having an issue upgrading an installation on Windows Terminal Server when installing as an administrator for all users.

The initial installation is run manually from the executable. The upgrade is initiated by the installed application, but with the flags /qn+ (no UI until completion). The installer UI has two options based on a checkbox (setting the property ALLUSERS): install for the current user or install for all users. When "install for all users" is unchecked, the install path is "C:\Users\%user%\AppData\Roaming". When it is checked, the install path is "C:\Program Files (x86)". The installer script uses three custom actions to attempt to accomplish this, all run after the Installation Execution Stage "Searches":

1. Set APPDIR to [APPDIR] for "Install, First time install" or "Uninstall, Regular uninstall" if ALLUSERS = "".
2. Set APPDIR to [ProgramFilesFolder]\[Manufacturer]\[ProductName] for "Install, First time install" or "Uninstall, Regular uninstall" if ALLUSERS = 1.
3. Set APPDIR to [ProgramFilesFolder]\[Manufacturer]\[ProductName] for "Install, Upgrade" or "Uninstall, Replaced by a new version" if TerminalServer = 1.

1 and 2 are intended for the manual, UI install. 3 is intended for the upgrade.

The regular install/upgrade works, but the all users upgrade ends up creating a new installation in the default APPDIR ("C:\Users\%user%\AppData\Roaming"). How can I get the silent upgrade to work for all users?

Thanks,
Scott

Daniel
Posts: 6533
Joined: Mon Apr 02, 2012 1:11 pm
Contact:

Re: Upgrading an install for all users

Postby Daniel » Thu Dec 07, 2017 10:39 am

Hello Scott,

You should make sure that during a silent installation you also set the check box property (used to set ALLUSERS) by command line. Something like this:

Code: Select all

msiexec /i setup.msi /qn+ CHECKBOX_PROP="all users value"

Also, if you want the value of the CHECKBOX_PROP property be preserved from first time install to upgrade, then you can go to "Install Parameters" page and enable the "Set persistent property" option for your property.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

sstrader
Posts: 2
Joined: Mon Dec 04, 2017 1:50 pm

Re: Upgrading an install for all users

Postby sstrader » Tue Dec 12, 2017 8:58 pm

Daniel,

Thanks so much for the help! I got pulled away on another project but finally got back to installer fun.

I made changes according to your suggestions and that resolved the issue where two installs were created on upgrade. However, I'm seeing two additional issues. One I've resolved, one I haven't.

The first was very minor: during a shared install the admin's Roaming installation folder would get a separate, empty subfolder for each version (e.g. appname\1.2.3\install and appname\1.2.4\install). To fix it, I edited the aip as xml and removed [|ProductVersion] from the ExtractionFolder value. I looked "everywhere" in the UI to change that but couldn't find anything, so just went to the raw data.

The second item I could not resolve: after the upgrade, there are uninstall entries in Control Panel for each version. I read through this thread without any luck: viewtopic.php?t=20344. "Product Details \ Override Windows Installer programs list entry" is not checked and the upgrade code has not changed. Any further suggestions?

Thanks again,

Scott

Daniel
Posts: 6533
Joined: Mon Apr 02, 2012 1:11 pm
Contact:

Re: Upgrading an install for all users

Postby Daniel » Wed Dec 13, 2017 4:07 pm

Hello Scott,

Regarding the first issue, the related change can be done from our "Builds" page -> "Configuration" tab -> "Extract location" field. As a best practice for the future I just want to add a small note that we do not advise at all to manually edit (without using the AI application) our AIP project file. Manually edits could lead to broken projects. However, since your project was successfully built this was not the case for you this time. :)

Regarding the second issue, this could happen if you increase only the fourth field of you "ProductVersion". You can check this from "Product Details" page. If this is the case you should follow our "How do I remove the old version when using the fourth field of the Product Version?" article steps.

If this is still of no help please send us the AIPs (project files) of your old and new version to support at advancedinstaller dot com so we can investigate them.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube


Return to “Building Installers”

Who is online

Users browsing this forum: No registered users and 1 guest