Upgr. "Per-user only": Not suggesting already installed dir - 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!

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Upgr. "Per-user only": Not suggesting already installed dir

Hello everyone.

I have a problem with upgrading a "Per-user only" package (with "Automatically upgrade older product version" set):

When executing the installer for an upgrade, it suggests the folder specified in "Install Parameters"/"Installation Folders"/"Application Folder", instead of the folder of existing installation.

Am I doing something wrong? Is a workaround possible to make it suggest the folder of the existing installation?



With best regards

Clemens Anhuth
Attachments
Test_Upgrade_Folder.zip
(1.94 KiB) Downloaded 436 times
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hi,

I tested you project like this:
- I used a dummy file in the "Files and Folders" page
- in the "Product Details" page I set the Product Name to "Your Application"
- I built the project
- I saved the project with another name
- I changed the Product Name to "Your Application New" and increased the Product Version (a new Product Code was generated)
- I built the project
- I installed the first package
- when I installed the second package, it used the installation folder of the first one (as expected)

Therefore, I cannot reproduce the behavior you encountered. Did you follow the steps mentioned in the Upgrades article?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hello Cosmin,

I did not perform the steps you mentioned.

I only changed the version number, then built the installer. And did so a second time, which then doesn't suggest the correct installation folder.

Can you reproduce it this way? Is there anything wrong with this approach?



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hi,

After increasing the version you were prompted about changing the Product Code. Did you answer "Yes" or "No"? Also, please try following the steps I took.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hello Cosmin,

following your steps it suggests the wrong installation folder, too, but - and I forgot to mention that - you have to pick a different installation folder for the initial installation of the product, otherwise you cannot see any difference (it suggests whatever you have configured in the project - if you don't change that when installing it will suggest that folder again and the incorrect behavior won't be ovbious).



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hi,

I didn't specify it in the first post, but I also tested with a custom installation folder and the new package didn't use its default installation path. I just tested again to make sure, and the behavior is the same: the upgraded package uses the installation folder of the installed package.

Perhaps there is something you are overlooking. Have you tried following the steps in the Upgrades article? if the problem persists please provide a sample test case which shows this behavior. The test case should include:
- the AIP of the original package
- the AIP of the upgraded package
- the files used in the projects

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hello Cosmin,

playing with it further it seems not to be related to the "per-user only" setting, but instead to the use of a bootstrapper in a multi-language package (German, English) with the language choice dialog enabled.

Attached are two AIPs to reproduce the problem (the AIPs use themselves as files).



With best regards

Clemens Anhuth
Attachments
Test_Upgrade_Folder2.zip
Install installer generated by this second
(2.38 KiB) Downloaded 389 times
Test_Upgrade_Folder.zip
Install installer generated by this first
(2.32 KiB) Downloaded 445 times
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hi,

The code page used during the install process is the code page of the language in which the installation runs. Therefore, the Windows-1252 code page will be used for a German installation and the Windows-1253 code page will be used for a Greek installation.

When upgrading an installation by using a package with a different code page (for example upgrading a Greek package with a German one), the original installation path may contain characters which are not supported by the code page of the new installation. Therefore, in order to avoid problems caused by the original installation folder, the new package will use its default installation path.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hello Cosmin,

thank you for the explanation.

I think I would like to take the risk and use the path of the existing installation anyway. Is that path available as a property or so?



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hi Clemens,

You can get the path of the installation folder by using a search. This search can use a folder as its location or it can retrieve the path from the registry:

Code: Select all

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\<ProductCode>
where <ProductCode> is the Product Code of the package.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hello cosmin,

I will try that, thank you very much.



With best regards

Clemens Anhuth
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Upgr. "Per-user only": Not suggesting already installed dir

cosmin wrote:You can get the path of the installation folder by using a search. This search can use a folder as its location or it can retrieve the path from the registry:

Code: Select all

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\<ProductCode>
where <ProductCode> is the Product Code of the package.
Hi cosmin,

I created the following search "UPDATE_APPDIR":

Root: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[OLDPRODUCTS]
Name: InstallLocation
Type: Retrieve the raw value

Then in all my custom actions I try to get the property value via Session.Property("UPDATE_APPDIR"), but it is always "".

Using "Test" to test this works when I have the product installed and when I hardcode its product code to Key:

Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{product code here}

Is this the correct way to retrieve the value from the registry?



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hi Clemens,

Note that it is not recommended to use the OLDPRODUCTS property in your search because it contains the Product Codes of the older versions installed on the machine. Therefore, if there are multiple versions installed, the search will not work. A good solution would be to use the actual Product Code of each old version or to use a custom action which gets the Product Codes from the OLDPRODUCTS property.
Then in all my custom actions I try to get the property value via Session.Property("UPDATE_APPDIR"), but it is always "".
Are your custom actions set to "Immediate"? Note that only "Immediate" custom actions can access installer properties.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hello cosmin.
cosmin wrote:Note that it is not recommended to use the OLDPRODUCTS property in your search because it contains the Product Codes of the older versions installed on the machine. Therefore, if there are multiple versions installed, the search will not work.
OK. At the moment our software can only be installed once. If installed once, should the search work?


A good solution would be to use the actual Product Code of each old version or to use a custom action which gets the Product Codes from the OLDPRODUCTS property.
I can try to use an immediate custom action to get OLDPRODUCTS and to set it to another property (given that it only contains one product code) which I would then use in the search instead of [OLDPRODUCTS], but it shouldn't make a difference, should it?


Then in all my custom actions I try to get the property value via Session.Property("UPDATE_APPDIR"), but it is always "".
Are your custom actions set to "Immediate"? Note that only "Immediate" custom actions can access installer properties.
All my custom actions are set to "immediate" - and all other options in "Execution Options" are deactivated, so I cannot choose anyway.



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Upgr. "Per-user only": Not suggesting already installed dir

Hi,
At the moment our software can only be installed once. If installed once, should the search work?
Yes, the search should work if there is only one old version installed.
I can try to use an immediate custom action to get OLDPRODUCTS and to set it to another property (given that it only contains one product code) which I would then use in the search instead of [OLDPRODUCTS], but it shouldn't make a difference, should it?
No, it wouldn't make a difference. The custom action which accesses the property must be immediate no matter how the property was set.
All my custom actions are set to "immediate" - and all other options in "Execution Options" are deactivated, so I cannot choose anyway.
Where is the custom action scheduled? Note that the OLDPRODUCTS property is set during the "FindRelatedProducts" standard action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”