prevent side by side installs with "package per lang" model - 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!

toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

prevent side by side installs with "package per lang" model

G'day,

I'm using AI 7.7 build 28804

Originally, I was building only an English install package, but now I need to build install packages for several languages. Because my localized resources are large (images with text, etc), I am creating a separate install package for each language. Additionally, my app is not designed to handle side-by-side installs, so it is very important that only one instance of the app be allowed per-user.

As stated in the Product Identification documentation,
The ProductCode property is a unique GUID used to identify your application. This identifier varies from version to version, or between different languages of the same installer. You can check this first hand from Advanced Installer by going to Project->Options->Project IDs. You will notice a different ProductCode associated with each language your installer supports.
Because AI gives each language a unique ProductCode, users are able to install multiple instances of the same version. For example, a user can install both the English and the German packages for version 1.0.0

I realize that one way I could prevent this is to create only a "multilingual package" so that there is only one ProductCode. However, as I stated earlier, the localized resources for my app are quite large (lots of images with text, etc) so putting them all in a single package is not feasible - the package will be too large.

I think another way to prevent these type of side-by-side installs would be to use the same ProductCode across all the languages in my project. Interestingly, it seems that previous versions of AI defaulted to that behavior (one ProductCode for all languages in the project), but that behavior was changed at the request of at least one user.

So, how can I share the same ProductCode across all of the languages? Well -

(1)
I am aware that I can manually edit the ProductCode, but this is not a viable long-term solution. I have AI nicely integrated with our continuous-build system and do not want any manual steps.


(2)
I am also aware that I can set it from the command-line using the /SetProductCode flag. However, the limitation I see with this approach is that I must provide the ProductCode (GUID) myself. When I change the Product Version (1.0.0 -> 1.0.1) I must provide a new GUID. Previously, when I only needed to build a single English package, I could simply use the /SetVersion flag and AI would automatically generate a new GUID for me. I would strongly prefer to let AI handle the GUID for me, so that I do not need to maintain a separate list of GUIDs myself.

The /SetProductCode documentation also states that the GUID parameter is optional, and that a new one will be generated if I do not provide one. That almost solves my problem, but then how can ensure all languages use this new GUID? It seems a new GUID will be generated for each language. If let AI automatically generate a new GUID for the default language (English), and then force the other languages to use that GUID, I suppose that would work, but I would need the ability to "query" AI and ask for the new GUID for English and no such query functionality exists (to the best of my knowledge).

Also, if I already passed the /SetVersion flag and thus allowed AI to generate a new GUID, does the /SetProduceCode flag (with or without a GUID given by me) then over-write the GUID with the new value?


Thanks very much for any insight you can provide on this situation,
Todd
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: prevent side by side installs with "package per lang" model

Hi Todd,
I think another way to prevent these type of side-by-side installs would be to use the same ProductCode across all the languages in my project. Interestingly, it seems that previous versions of AI defaulted to that behavior (one ProductCode for all languages in the project), but that behavior was changed at the request of at least one user.
Right now, in Advanced Installer, the same product code is kept for different builds of the same language . The thread above is about different product codes for different builds of the same language. This is the improvement my colleague is referring to.
I suppose that would work, but I would need the ability to "query" AI and ask for the new GUID for English and no such query functionality exists (to the best of my knowledge).
The Advanced Installer project files are XML files. You can try to use your command line tool to parse the project file and get the Product Code. Another approach would be to find a tool that takes the Product Code from a MSI and overwrites it in another MSI.
Also, if I already passed the /SetVersion flag and thus allowed AI to generate a new GUID, does the /SetProduceCode flag (with or without a GUID given by me) then over-write the GUID with the new value?
Yes, it does. The /SetVersion command will change the version and generate a new GUID,then the /SetProductCode command will set the GUID to your desired value.

Please make sure that after you make the Product Code identical for all you packages, you also do the same with the Upgrade Code.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

Re: prevent side by side installs with "package per lang" model

Thanks for your reply, Mihai.
Right now, in Advanced Installer, the same product code is kept for different builds of the same language . The thread above is about different product codes for different builds of the same language. This is the improvement my colleague is referring to.
Thanks for clarifying that - it seems I misinterpreted the forum post.

The Advanced Installer project files are XML files. You can try to use your command line tool to parse the project file and get the Product Code. Another approach would be to find a tool that takes the Product Code from a MSI and overwrites it in another MSI.
I realize that I could parse the XML directly to get the new ProductCode, but I was hoping to avoid that situation since it is a bit hacky.

I also do not want to tinker with the MSIs and change the Product Code after they have been created. That approach has a lot of potential risks and I also do not want to introduce another new tool into the automated build process.

Please make sure that after you make the Product Code identical for all you packages, you also do the same with the Upgrade Code.
After looking at the Project IDs dialog, it seems that the Upgrade Code is already shared across all of the languages and does not change even if the Product Code or Product Version is updated. So, if I only have one AI project, I shouldn't need to worry about changing the Upgrade Code, correct?


It seems that currently there is no easy way to prevent side by side installs under the "one installer per language" model. As suggested, I will probably parse the XML to get the Product Code and then use the /SetProductCode flag for each language. However, please consider my forum-post as a formal feature-request; it would be great if AI could provide an easy, configurable option which prevents side by side installs under the "one installer per language" model.

Thanks for your help,
Todd
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: prevent side by side installs with "package per lang" model

Hello Todd,
After looking at the Project IDs dialog, it seems that the Upgrade Code is already shared across all of the languages and does not change even if the Product Code or Product Version is updated. So, if I only have one AI project, I shouldn't need to worry about changing the Upgrade Code, correct?
Yes, this is correct.

Thank you for your suggestion. We will consider adding this improvement in a future version of Advanced Installer.

Best wishes,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: prevent side by side installs with "package per lang" model

Hello Todd,

I have tested and discussed your issue with our team. If you have a single project that generates several language packages, even though each package has its own individual Product Code, the packages won't install side by side.
This happens because when you have a single project, you have the same Package Code for all its generated packages. As this Package Code is compared before the Product Code and it is the same for all languages, Windows Installer won't install the same package in another language, instead it will enter the maintenance mode.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

Re: prevent side by side installs with "package per lang" model

Thanks for the follow-up, Mihai.

I checked the Package Code for each of the installers generated from my project and you are correct - the Package Code is the same for all. Regardless, I am still observing behavior whereby the installer does *not* enter maintenance mode even though an existing version with the same Package Code (but different language) is already installed.

After some additional testing it seems the "Enhanced User Interface" feature is the culprit. The following configuration/steps can be used to reproduce the problem:

----- Project -----
* contains translations for two languages, English and German
* configured to create separate packages for each language
* configured to use the "Enhanced User Interface" (Enhanced UI), only on install

----- Steps -----
1) run the English package, which installs normally
2) run the English package again
3) the installer displays the MaintenanceWelcomeDlg (as expected)
4) upon clicking the Next button, the installer displays the MaintenanceTypeDlg (as expected)
5) click Cancel, installer exits

so far, so good

6) now run the German package
7) the installer displays the WelcomeDlg, *not* the MaintenanceWelcomeDlg
8) upon clicking the Next button, the installer displays the standard "First Time Install" dialogs and never enters maintenance mode
9) on the FolderDlg, choose a different path (different than where you installed the English package)
10) click-through the remainder of the dialogs
11) at the end of the install sequence, it seems like the install was successful (no errors), but the German package is not installed in the new location

----- Change Config -----
* change the project so that it never uses the Enhanced UI, rebuild the packages
* re-run steps 1-7
* when you reach step #7, the German package will enter maintenance mode and display the MaintenanceWelcomeDlg (as expected)

The problem is very easy to reproduce - just turn the Enhanced UI on/off. Could you please confirm this bug?

It seems like the only work-around is to use the Basic UI and not the Enchanced UI, but the Enhanced UI offers a much better experience for the end-user so I would prefer to keep it.

Thanks for your help,
Todd
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: prevent side by side installs with "package per lang" model

Hello Todd,
The problem is very easy to reproduce - just turn the Enhanced UI on/off. Could you please confirm this bug?
Yes, I can reproduce and confirm this issue. A fix will be available in the next version of Advanced Installer, thank you for bringing it to our attention.
It seems like the only work-around is to use the Basic UI and not the Enchanced UI, but the Enhanced UI offers a much better experience for the end-user so I would prefer to keep it.
Actually, after testing your issue I could come up with a workaround so you can also keep the Enhanced UI option enabled in your project.

Here are the steps :
1. go to the Upgrades page and add a new Upgrade ;
2. ignore the browse popup and instead type ;

Code: Select all

 [|UpgradeCode] 
in the Upgrade Code field ;
3. in the Min. and Max. Version field type

Code: Select all

[|ProductVersion]
4. select the "Detect only, placing the results in property" radio button, uncheck "Enable Migrate Features action" and "Continue installation upon failure to remove a product" options ;
5. use the Result Property to create a Custom Launch Condition. e.g.:
Condition:

Code: Select all

NOT UPGRADE_1
Description: This package is already installed in another language !

Best Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

Re: prevent side by side installs with "package per lang" model

Thanks for confirming the problem with the Enhanced UI. I'll look for the fix in the next version of AI.

Regarding the short-term work-around, it is successful only if I leave the "Max Version" field empty. If I enter [|ProductVersion] in the "Max Version" field (as per your instructions), the original problem still exists. I've never used the AI "Upgrades" functionality in this manner, so could you please confirm whether leaving the Max Version field empty is correct?

Also, I'm wondering whether this work-around will cause any complications or errors when upgrading older versions of the same product which have already been released to users. I did some basic testing of upgrading older versions and things seem to be working fine, but I'm just concerned about edge-cases which I may have over-looked.

Finally, when the bug with the Enhanced UI is fixed, can I simply delete this Upgrade and the Custom Launch Condition, and then everything should still work properly in terms of upgrading older versions (some of which were built without this custom condition, and some of which were built with this custom condition)?

Thanks again for all of your help on this issue,
Todd
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: prevent side by side installs with "package per lang" model

Hi Todd,
Thanks for confirming the problem with the Enhanced UI. I'll look for the fix in the next version of AI.
Actually we have the 8.0 release planned soon, but as the development for this version was already over yesterday when you reported the bug, its fix will be handled by the development team for a future version.
Regarding the short-term work-around, it is successful only if I leave the "Max Version" field empty. If I enter [|ProductVersion] in the "Max Version" field (as per your instructions), the original problem still exists. I've never used the AI "Upgrades" functionality in this manner, so could you please confirm whether leaving the Max Version field empty is correct?
Please add the "Max Version" as I said in my post and then check the "Include minimum versions in range" and "Include maximum versions in range" options. These options will ensure that this workaround upgrade refers strictly to the current product version and will not interfere with any other real planned upgrades.
Also, I'm wondering whether this work-around will cause any complications or errors when upgrading older versions of the same product which have already been released to users.
I have discussed this issue with the team and we are not aware of any complications that might appear as a result of this workaround. Please run some random tests though, just to ensure the logic.
Finally, when the bug with the Enhanced UI is fixed, can I simply delete this Upgrade and the Custom Launch Condition, and then everything should still work properly in terms of upgrading older versions (some of which were built without this custom condition, and some of which were built with this custom condition)?
Yes, with the fix ready you won't need the workaround anymore.

Best wishes,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

Re: prevent side by side installs with "package per lang" model

Thanks for the follow-up.
Please add the "Max Version" as I said in my post and then check the "Include minimum versions in range" and "Include maximum versions in range" options. These options will ensure that this workaround upgrade refers strictly to the current product version and will not interfere with any other real planned upgrades.
I added [|ProductVersion] to both the Min and Max Version fields, and I selected both check-boxes to include the min/max versions in the range. I retested and it appears to be working properly - packages differing only by their ProductLanguage cannot be installed side-by-side.

I'm not certain, but I think the reason it was not working for me yesterday is because I didn't select the "Include maximum version in range" check-box. Anyhow, I'm glad it's working now.

I increased the Product Version and created several versions of the package so that I could run more test-cases; everything seems to be working as expected. Thanks very much for your help with this, I sincerely appreciate it.


I did want to point-out one small defect that I noticed when creating the Upgrade. When I click the "New" button, I entered all of the values per your instructions:
AI - new upgrade.JPG
AI - new upgrade.JPG (34.45 KiB) Viewed 18495 times
After clicking "OK" in the "New Upgrade" dialog, I verified that both the Min. Ver. and Max. Ver. columns contain the ProductVersion property:
AI - saved upgrade.JPG
AI - saved upgrade.JPG (16.56 KiB) Viewed 18495 times
so far, so good

However, if I then edit the Upgrade, the "Max Version" field is empty inside the "Edit Upgrade" dialog:
AI - edit upgrade.JPG
AI - edit upgrade.JPG (33.42 KiB) Viewed 18495 times
I even tried closing and reopening my project to be sure all in-memory values had been written to the aip file, but the same problem exists. I think that may have caused some confusion for me yesterday when I was testing. Anyhow, seems like a minor bug.

Thanks again, Mihai.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: prevent side by side installs with "package per lang" model

Hi Todd,

I'm glad the workaround is working for you.
Yes, I am aware of the Max Version bug you reported, I noticed it when I was figuring out the issue.
I added the fix on our TODO list and it will be solved by the development team in a future version.

Thank you for the feedback,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

Re: prevent side by side installs with "package per lang" model

Thanks for confirming the issue, Mihai.

-Todd

Return to “Common Problems”