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.
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).
我相信您正在创建每用户安装,因此Windows操作系统会将ProgramFilesFolder
重定向到用户的Appdata,有关详细信息,请查看http://msdn.microsoft.com/en-us/library/windows/桌面/ dd765197(v = vs.85)的.aspx
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.