开发者

bad install directory path

I am creati开发者_运维技巧ng a setup project in WiX, I've used WixUI_Common as a base and extended it with my custom dialogs. But when the user gets to the InstallDirDlg dialog, the installation path is "C:\", and this is totally unacceptable. Although previously in the code I've set:

<Directory Id="TARGETDIR" Name="SourceDir">
            <Component  Id="Component_SetupCM.wxs" Guid="60A58B24-CA71-44CE-947F-6BBDC7C6C89C" >
                <File Source="Product.wxs" Id="Product.wxs" KeyPath="yes"/>
            </Component>
        </Directory>
<Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" />

So what could be the problem?


you need something like this:

<DirectoryRef Id = TARGETDIR>
  <Directory Id = "ProgramFilesFolder">
    <Directory Id = "INSTALLDIR" Name = "MyAppName"/>
  </Directory>
</Directory>

<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />

The problem you are have is that TARGETDIR = c:\

UPDATE: As long as you have the line

<Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" />

You will continue to have the same problem. TARGETDIR = c:\ and it always will. Notice in my example I set WIXUI_INSTALLDIR to INSTALLDIR and not TARGETDIR. The problem with your code was not the directory structure so much as that you were setting WIXUI_INSTALLDIR to the wrong value. My solution above works as I copied it from a project I'm currently using.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜