AWarn
Posts: 17
Joined: Wed Sep 14, 2016 11:32 am

Patch changes environment variables

I have a problem that one of my patches changes all environment variables during installation. This leads to a problem when users installed our software in another directory than our default APPDIR=[WindowsVolume]geopp

I usually just copy my previous used project (e.g. 1.6.0 -> 1.6.1), edit the new version numbers and exchange a few executables that must be included in the patch. The generated msi are named the same and the patch 1.6.1 is fine. The next patch 1.6.2. was again copied from 1.6.1 project and my depot was updated by a few files.
My patches were always generated between adjacent version, means in 1.6.2 Target image is 1.6.1 and Upgraded Image 1.6.2.
Why can it be that 1.6.2 for instance changes all my environment variables back to default APPDIR although the correct path is updated? The next patch 1.6.3 again do not change the variables.
Does anyone has any idea?
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Patch changes environment variables

Hello,

Could you please open your 1.6.2 AIP project and check if the environment variable is correctly configurated in "Environment" page? If it is, please send us both 1.6.1 and 1.6.2 .AIPs (projects) and a verbose log of the patch installation to support at advancedinstaller dot com so we can investigate them.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AWarn
Posts: 17
Joined: Wed Sep 14, 2016 11:32 am

Re: Patch changes environment variables

The issue has been solved by me and can be closed. Thank you for your reply.
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Patch changes environment variables

Hello,

I'm glad that you've sorted things out!

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AWarn
Posts: 17
Joined: Wed Sep 14, 2016 11:32 am

Re: Patch changes environment variables

Hello,

I have to come back to this issue because I still face this problem. I want to release a new version of our software, therefore I have changed the product code, but not the upgrades code. The setting "Use original installation path when upgrading" is enabled and the installer founds the previous installed version (OLDPRODUCTS is detected and the SetupTypeDlg is skipped). Nevertheless it will always be installed to APPDIR folder as set in "Installer parameters".
What is the important setting to detect the APPDIR of the previous version? Maybe I can manipulate something on that side.

Regards,
Andre
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Patch changes environment variables

Hello Andre,

We are not sure why you encounter this behavior. Could you send us both your .AIP projects (old and upgrade) to support at advancedinstaller dot com so we could have a better view of your scenario?

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AWarn
Posts: 17
Joined: Wed Sep 14, 2016 11:32 am

Re: Patch changes environment variables

I found out that my main package sets the paths correct but my patch always sets the paths to APPDIR back. This is problematic when someone installed to e.g. D:\ during the main package installation but the path puts it back to C:\... due to the APPDIR=[WINODWSVOLUME]... setting.
It looks for me as that the upgraded folder is used from the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders.

Attached you will find the last main package and first patch to find out why last of these changes the paths during installation
Attachments
patch161.aip
(3.15 KiB) Downloaded 797 times
main161.aip
(530.06 KiB) Downloaded 811 times
main160.aip
(529.96 KiB) Downloaded 939 times
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Patch changes environment variables

Hello,

I have built your projects with dummy resources but couldn't reproduce your issue.

In order to further investigate this problem, could you give us a detailed step-by-step testcase along with the encountered behavior?

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AWarn
Posts: 17
Joined: Wed Sep 14, 2016 11:32 am

Re: Patch changes environment variables

Dear Sorin,

we have main releases 0.X.0 which will update major features of the software and patches in between (0.0.X) which just update single or a few files. For the first time install the user can decide where to install (in SetupTypeDlg - e.g. E:\packagename) other than the default APPDIR. But I found out that the patches (patch161) had changed the registry and overwrites all paths with APPDIR which is [WindowsVolume]name. With the new main release version I have the problem that the installer on first hand finds the old version and skips the SetupTypeDLG but always installs to APPDIR folder ([WindowsVolume]name) because it finds the changed path probably in the registry. I try now to change back all registry entries I found which could be relevant before the installation so that the original path can be used, but currrently fail with my custom action. I assume my action is initializes just after the search for the upates path.
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Patch changes environment variables

Hello Andre,

I've investigated this and I can reproduce and confirm this issue. It seems that after a patch, the APPDIR is not correctly preserved for a major upgrade. A fix will be available in a future version.

Until them, could you implement the following workaround?
- go to "Search" page and create a new Search. Rename it's associated result property to "APPDIR"
- right click on this new search and select "Add Search Location" - "Registry"
- configure the "Registry Location Properties" as follows:
Root: "HKEY_LOCAL_MACHINE"
Key: "SOFTWARE\[Manufacturer]\[ProductName]"
Name: "Path"
Type "Retrieve the raw value"

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AWarn
Posts: 17
Joined: Wed Sep 14, 2016 11:32 am

Re: Patch changes environment variables

Dear Sorin,

I am wondering about this solution because this path contains the incorrect install path which was changed by the patch. I have changed this now to one of our own environment variables in SYSTEM\ControlSet001\Control\Session Manager\Environment and now it works. But thanks for this workaround option.

Best regards,
Andre
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Patch changes environment variables

Hello Andre,

I'm glad that you've sorted things out. I've tested my solution by building your projects with dummy resources and it worked fine on our side.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Patch changes environment variables

Hello,

This was fixed in version 14.9 of Advanced Installer released on May 24th, 2018.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”