0
votes

I'm using Wix to create and installer for my .exe.

My directories structure:

<!--Directory structure-->
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="APPLICATIONFOLDER" Name="MyApp" >
      <Directory Id="MyAppBin" Name="Bin" />
        <Directory Id="MyAppRes" Name="Data">
          <Directory Id="MyAppResDE" Name="de" />
          <Directory Id="MyAppResEN" Name="en" />
      </Directory>
    </Directory>
      <Directory Id="ProgramMenuFolder">
        <Directory Id="MyShortcutsDir" Name="MyApp" />
      </Directory>
    </Directory>
</Directory>

I use <UIRef Id="WixUI_Advanced" />, so I get the installer with "Advanced" and "Install" options.

When I click "Advanced", the default installation path is:

C:\Program Files (x86)\MyApp\

But when I choose just "Install", program is being installed under:

C:\Users\PolGraphic\AppData\Local\Apps\MyApp\

Maybe it's because default installation will "choose" "only for that user".

Anyway, how to force installer to install under "C:\Program Files (x86)\MyApp\" by default (when I click just "Install" instaed of "Advanced")?

I don't mind if it will be for all users or just "that user" by default.

2
Try to set INSTALLLOCATION property - Nerielle

2 Answers

2
votes

To expand on llirB's answer installs are by default on a 'per user' basis and that means you are getting ProgramFilesFolder set to that user's %APPDATA%.

If you want the install to always be in C:\Program Files (x86)\MyApp\ you need to set

InstallScope="perMachine"

in your Package tag. This will define the correct windows installer properties indicating this install is for all users (aka. install into Program Files).

0
votes

I believe you are creating Per-User installation and because of that the Windows OS will redirect ProgramFilesFolder to the user's Appdata, for more details please take a look at http://msdn.microsoft.com/en-us/library/windows/desktop/dd765197(v=vs.85).aspx