saving a file to 64 bit folder from 32 bit installer - Advanced Installer Community
lornemartin
Posts: 11
Joined: Tue Jul 19, 2022 1:18 am

saving a file to 64 bit folder from 32 bit installer

I would like to install some Firefox preferences to a folder on the target machine conditionally based on whether the user has 64 bit or 32 bit Firefox installed. If the target machine has a folder named C:\Program Files\Mozilla Firefox\defaults\pref\, I want to write two files to it. If the target folder has a folder named C;\Program Files (x86)\Mozilla Firefox\defaults\pref\, I want to write the same two files to it. I know how to set up search conditions to install the files based on whether the folders exist, but my problem is that I would prefer to keep the installer 32 bit rather than mixed-mode to reduce installer size and complexity. Is there any way to write files to a 64 bit folder location from a 32 bit only installer?
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: saving a file to 64 bit folder from 32 bit installer

Hello and welcome to our forums,

The solution to this would be to add the files twice and mark their components as 64-bit so the installer writes them in the 64-bit version of Program Files.

You can do so by right clicking the file --> "Go to component".

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
lornemartin
Posts: 11
Joined: Tue Jul 19, 2022 1:18 am

Re: saving a file to 64 bit folder from 32 bit installer

Thanks for the reply. I had tried this already and it doesn't seem to work that way for me. But I must be doing something wrong. I have attached my aip file for your review. It only has the files added to the 'Program Files 64' folder, but they get installed to my Program Files (x86) folder when I run the installer.
Attachments
DrawbridgeAgent.aip
(318.9 KiB) Downloaded 212 times
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: saving a file to 64 bit folder from 32 bit installer

Hello,

I have run some tests on my end and it is not something you have done wrong, but rather an issue with Advanced Installer.

The workaround I've been able to come up so far is this:

- add the file as a temporary file

- create a PowerShell script that copies the files from the temporary folder into the desired folder

An example of such script would be:

Code: Select all

#Requires -version 3
Param($tempFile)

Add-Type -AssemblyName PresentationFramework

[System.Windows.MessageBox]::Show($tempFile)

$programFiles = $env:programfiles

$destination = New-Item "$programFiles\testFolder" -type Directory

Copy-Item -path $tempFile -destination $destination
Below, please find attached a sample project in which you can see the whole configuration for the custom action:
Your Application.aip
(16.34 KiB) Downloaded 216 times
The "AI_ASD.TXT" is the property that stores the path to the temporary file. You can retrieve the property by right clicking on the file --> "Properties".

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: saving a file to 64 bit folder from 32 bit installer

Hello,

After further investigations, it looks like this is the default behavior of Windows Installer that is leading to this.
MSI (s) (88:2C) [16:10:20:707]: WIN64DUALFOLDERS: 'C:\Program Files (x86)\' will substitute 17 characters in 'C:\Program Files\' folder path. (mask argument = 0, the folder pair's iSwapAttrib member = 0).
MSI (s) (88:2C) [16:10:20:709]: PROPERTY CHANGE: Modifying ProgramFiles64Folder property. Its current value is 'C:\Program Files\'. Its new value: 'C:\Program Files (x86)\'.
With that being said, please use the workaround I've mentioned above.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”