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!

jesper
Posts: 5
Joined: Mon Feb 25, 2008 9:17 pm

.NET app installer - 32/64 bit Windows

We are creating an installer for a .NET application.
This .NET application is pure managed code and is compiled for "AnyCPU", which means that it runs 32 bit on Windows 32 bit version and it runs 64 bit on Windows 64 bit computers.

How can I make this install to the correct location by default without having to make two installers?

It should go to "c:\program files" by default on both 32 and 64 bit Windows.
But it defaults to "c:\program files (x86)" on 64 bit Windows - which is wrong since this is NOT a x86 program.

How can I correct this?

Thanks in advance.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

In the "Files and Folders" page there are the "Program Files" and "Program Files 64" folders. The "Program Files" folder is for 32-bit systems ("Program Files (x86)" on a 64-bit system) and the "Program Files 64" folder is for 64-bit systems (it doesn't have an equivalent on 32-bit systems).

For your case, you can set the APPDIR property (which corresponds to the "Application Folder" directory) according to the system on which the installation is run. Here are the steps:
- add your files in the "Application Folder" directory in the "Files and Folders" page
- go to the "Custom Actions" page and show the "InstallUISequence" -> "CostFinalize" standard action (you can use the "Show Standard Action" button on the toolbar)
- create a new "Property set with formatted" custom action under "InstallUISequence" -> "CostFinalize"
- set the "Property Name" field to APPDIR, the "Formatted Text" field to [ProgramFilesFolder][Manufacturer]\[ProductName] and the "Expression" field to NOT VersionNT64
- create another "Property set with formatted" custom action under the first one
- set the "Property Name" field to APPDIR, the "Formatted Text" field to [ProgramFiles64Folder][Manufacturer]\[ProductName] and the "Expression" field to VersionNT64

These custom actions will set the APPDIR property based on the system type (32-bit or 64-bit). You can read more about custom actions here:
http://www.advancedinstaller.com/user-g ... -page.html
Also, you can find information about the "VersionNT64" property here:
http://msdn2.microsoft.com/en-us/library/aa372497.aspx

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jesper
Posts: 5
Joined: Mon Feb 25, 2008 9:17 pm

Worked perfectly :-)

Thank you very much.
jesper
Posts: 5
Joined: Mon Feb 25, 2008 9:17 pm

I take that back.

It just shows the correct path in the installer GUI - it doesn't actually install to that location.

Is Windows doing some kind of redirection on this?
Perhaps because the installer is 32 bit - it redirects "program files" to "program files (x86)"?

I am testing on Windows Server 2003 x64 Edition.

Please help.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

It seems that Windows Installer detects that you are installing a 32-bit application (because the package type is set to 32-bit) and redirects the installation folder to "Program Files (x86)".

Please try this approach:
- remove the custom actions
- go to the "Install Parameters" page and in the "Package Type" combo select the "Mixed 32/64-bit matching the platform" option
- click the "..." button next to the combo and select the "Install all components" option
- go to the "Bootstrapper" tab in the "Media" page and select the "Include install files in EXE" option (this is optional)

Now the default installation path will be [AI_ProgramFiles][Manufacturer]\[ProductName] which is always resolved to the "Program Files" folder.

You can read more about this here:
http://www.advancedinstaller.com/user-g ... types.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jesper
Posts: 5
Joined: Mon Feb 25, 2008 9:17 pm

I can't find this "Mixed 32/64" option that you mention.

Package types are "32 bit", "64 bit for x64", and "64 bit for Itanium" only.

Using v. 6.1.1.

Please advice.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Note that this feature is available only in an Enterprise project. You can change the type of your project by using the "Project Type" tab in the "Project" -> "Options" menu.
http://www.advancedinstaller.com/user-g ... e-tab.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jesper
Posts: 5
Joined: Mon Feb 25, 2008 9:17 pm

Doesn't that require an "Enterprise" license?

We have no need for any enterprise features (small shop here) - can't this be done with our Professional license?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Yes, an Advanced Installer Enterprise project requires an Enterprise license.

Also, I'm afraid that this cannot be done with a Professional license (the package must be seen as a 64-bit package in order for Windows Installer to allow it to install in the "Program Files" folder).

In your case, perhaps it is better to install your application in the "Program Files (x86) folder" or to create separate installation packages (one for 32-bit and one for 64-bit systems).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

Re: .NET app installer - 32/64 bit Windows

I am trying to do the same thing as well.

But in your instruction
- click the "..." button next to the combo and select the "Install all components" option
I don't see the "Install all components" option you are talking about. Maybe that is from an older version. I get a wizard in 6.8 Enterprise.

But the wizard doesn't seem to explicitly address the .net scenario. I just want the same .EXE to be seen as 32 and 64 bit, on each respective machine.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: .NET app installer - 32/64 bit Windows

Hi,
I don't see the "Install all components" option you are talking about. Maybe that is from an older version. I get a wizard in 6.8 Enterprise.
Newer Advanced Installer versions use a wizard for configuring a mixed 32/64-bit installation.
I just want the same .EXE to be seen as 32 and 64 bit, on each respective machine.
Please note that Advanced Installer cannot control how the EXE is seen by Windows. This is controlled from with the EXE. However, through a mixed 32/64-bit installation Advanced Installer allows you to install the application in 32-bit locations on 32-bit systems and in 64-bit locations on 64-bit systems.

Can you please give me more details about what you need to do and doesn't work for your package?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

Re: .NET app installer - 32/64 bit Windows

As you may know, .NET applications can be build for "AnyCPU". When doing so, the EXE produced is compatible with either 32 or 64-bit systems, because it is compiled at runtime by the .NET framework.

The Mixed 32/64 wizard seems to address cases where you have processor-specific binaries, and the case where you have a 32-bit binary that you want installed on a 64-bit system anyway.

But in my case, which I'm sure is like many/most .NET developers, I just want the same EXE to be installed *as though* 32-bit on a 32-bit system, and as though 64-bit on a 64-bit system.

I have taken a queue from http://www.advancedinstaller.com/user-g ... types.html and set my application folder to [AI_ProgramFiles], and that seems to result in the EXE being placed in "Program Files" on both platforms.

But it's unclear whether the "Mixed 32/64-bit matching the platform" setting has any other impact for .NET cases like mine where I want exactly the same files placed on either system.

It's also unclear what impact selecting "64-bit component" in the Organization tab has. I understand that one must choose 64-bit for registry entries to avoid virtualization (Wow6432), but what impact does the setting have on components containing, say, the EXE, or other files?

I'm afraid this 64-bit stuff is confusing in the .NET case, as it seems there are a number of related settings, some unclear combination of which (hopefully) results in an "AnyCPU" application in installing on a 64-bit system exactly as it would on a 32-bit system.

This is related to http://www.advancedinstaller.com/forums ... 836#p21836
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: .NET app installer - 32/64 bit Windows

Hi,
I just want the same EXE to be installed *as though* 32-bit on a 32-bit system, and as though 64-bit on a 64-bit system.
Since the EXE is not specific to a platform, it can be included in the common feature (the feature which is installed on both 32-bit and 64-bit systems).
It's also unclear what impact selecting "64-bit component" in the Organization tab has.
Based on this option Windows Installer determines if the resource is 32-bit or 64-bit and installs it in the appropriate location. Also, this option marks the package as 64-bit. Please note that this option does not affect the resource itself.
I understand that one must choose 64-bit for registry entries to avoid virtualization (Wow6432),
Please note that the virtualization is not related to this (it is a Vista concept for legacy applications). A 64-bit system has two sets of locations:
- 32-bit locations for 32-bit packages and components
- 64-bit locations for 64-bit packages and components

If the component of your EXE was not marked as 64-bit, it would be installed in a 32-bit location ("Program Files" on a 32-bit system and "Program Files (x86)" on a 64-bit system). If it's marked as 64-bit it is installed in a 64-bit location ("Program Files").

Since you are using the custom Advanced Installer property, the installation folder is set automatically according to the platform type (a 32-bit folder for 32-bit systems and a 64-bit folder for 64-bit systems). This way you don't have to create two copies for the common files (one in the "Program Files" folder and one in the "Program Files 64" folder from "Files and Folders" page).

Basically, for your application you can use a mixed package with the EXE set to be installed on both platforms. If you use the Advanced Installer custom property, the EXE will be automatically installed in a 32-bit folder on a 32-bit machine and in a 64-bit folder on a 64-bit machine.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

Re: .NET app installer - 32/64 bit Windows

I've summarized my working settings at http://www.advancedinstaller.com/forums ... 836#p21836

Return to “Common Problems”