Windows installation / installation project: forced installation in "program files", not x86?

My boss needs to install to install software on one of our client machines. He wants the software to be installed specifically in "C: \ Program Files \ HisApplicationName" rather than "C: \ Program Files (x86) \ HisApplicationName". I know that the correct answer would be to rewrite the software to place any directory that the user wants to install, but, unfortunately, this is very old software and needs to be installed tomorrow, so we just want to force the installer to point to the client "Program Files" directory .

My problem is that when I rigidly set the path to the file in the installer property "DefaultLocation", the installer still tries to point to the Program Files (x86) directory.

Is there a way to force the Windows installation / installation package to specify program files, rather than "Program Files (x86)"?

Thanks.

+4
source share
1 answer

What you are asking to do simply is not possible with the Windows installer, with the exception of one unsupported disruptive hack.

Install INSTALLDIR in C:\Progra~1\.....

See MSI has backward compatibility functionality that automatically "fixes" any hard-coded links from C:\Program Files\ to C:\Program Files (X86) when MSI is marked as 32 bits. It cannot calculate the shortname version and redirect it so that my hack works. Assuming they did not disable the short file name system.

The only correct way to install on C:\Program Files is to mark MSI as 64-bit and use the ProgramFiles64Folder property instead of the ProgramFilesFolder property.

By the way, if your boss does not believe you, I suggest finding a new boss. I have written installers for 16 years, and I have never allowed some PHBs to make such decisions. I am a Windows Installer expert, not him.

+14
source

Source: https://habr.com/ru/post/1401509/


All Articles