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!

R.Mueller
Posts: 202
Joined: Thu Aug 02, 2012 3:31 pm

Avoid installing wrong package with Mixed 32/64-Bit packages

Hi,

how can I avoid, that the user installs the 32-Bit package of a mixed 32/64-bit package on a x64-bit system? He needs just to execute the msi package directly, instead of setup.exe.

I tried to use AI_PACKAGE_TYPE as Launch Condition, unfortunately this is set to the undocumented AI_ALL value instead of "Intel" or "x64". Is there a chance to reuse the AI_ProgramFiles and compare it with ProgramFilesFolder or something like this?

Regards,

RM
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Avoid installing wrong package with Mixed 32/64-Bit pack

Hi,

Unfortunately, there is no property that detects the type of a package.

Also, you can achieve what you want by following the steps below:
- we assume that your application uses the default Application Folder in the Install Parameters page ([AI_ProgramFiles][Manufacturer]\[ProductName] is used for a mixed package type)
- in the same page create a new property (i.e. MY_PATH)
- go in the Custom Actions page and create a "Set installer property" custom action, place it under the "Wizard Dialogs Stage" -> "Paths Resolution" action group and use the following settings:
  • Property: MY_PATH
    Formatted: [ProgramFilesFolder][Manufacturer]\[ProductName]\
- create a "Display error message" custom action, place it under the "Set installer property" custom action created earlier and use the following settings:
  • Message: This is a 32-bit package
    Condition: APPDIR = MY_PATH
- build and run the project

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
R.Mueller
Posts: 202
Joined: Thu Aug 02, 2012 3:31 pm

Re: Avoid installing wrong package with Mixed 32/64-Bit pack

Hi Eusebiu,

well, when I do so, its completely blocking the installation.

My scenario is the following: I have a installer using combined 32/64 packaging mode. That means, I get a 32-Bit msi, 64-Bit msi and setup.exe and a common cab file for installation. Currently its possible, that the end user on a 64-Bit system is able to start the 32-Bit msi file directly and therefore able to install our software in 32-Bit mode. This is not supported by us and therefore it should be avoided.

Question is, how to achieve that. I need a property or similar, which tells me, this is the 32-Bit msi, then can I test, if its currently running on a 64-bit system and avoid that.

Regards,

Roland
R.Mueller
Posts: 202
Joined: Thu Aug 02, 2012 3:31 pm

Re: Avoid installing wrong package with Mixed 32/64-Bit pack

Hi Eusebiu,

uuuh, after some MSI log file reading, I found a solution, which works based on the knowlegde how AI is producing the mixed packages. I already mentioned, that we use the mixed package type. When you do so, you will get a TheClient.msi, TheClient.x64.msi, TheClient.cab and setup.exe. Setup.exe is responsible for taking the right msi package.

I found the property OriginalDatabase which contains the msi package name (hence its called "Original..." I asume, that this property is based on the package name during creation of the installer). Now you just need to test, if the msi package name contains a x64 for being designed for x64:

Create a new Launch Condition, add as condition

Code: Select all

OriginalDatabase ~>< "x64" and VersionNT64
and as Description

Code: Select all

Please use the 64-Bit package for installations on a 64-Bit system!
and rebuild. When I start the packages directly, it shows me the message in case of the 32-Bit package on x64. The other case (installing x64 on x32) is blocked by MSI by default.

Is this a reliable solution for my problem?

Regards,

Roland
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Avoid installing wrong package with Mixed 32/64-Bit pack

Hi Roland,

I tested your scenario, but it looks like the installation of a 32-bit package is also blocked on a 32-bit system.

Indeed, my scenario behaves the same because I forgot to mention the right condition for the "Display error message" custom action, which is APPDIR = MY_PATH AND VersionNT64 instead of APPDIR = MY_PATH.

I attached a sample project, so you can take a look on it and also build and run it to see how it behaves.

Let us know if this helped.

Best regards,
Eusebiu
Attachments
Mixed 64-32 bit.aip
(17.29 KiB) Downloaded 536 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”