Wix将ProgramFiles设置为默认值

时间:2015-07-06 14:38:55

标签: wix

我正在尝试使用wix创建安装程序。我有这个设置

 <Feature Id='ClientInstallation' Title='SomeTitle' Level='1' ConfigurableDirectory='INSTALLLOCATION'>
  <ComponentGroupRef Id='ClientSystemGroup' />

  <Feature Id='SomeId' Title='SomeOtherTitle' Level='1'>
    <ComponentGroupRef Id='SomeSystemGroup' />
  </Feature>
</Feature>

.....

 <InstallExecuteSequence>
  <Custom Action='CA_CreateConfig' Sequence='1' />
  <Custom Action='DIRCA_TARGETDIR' Before='CostInitialize'><![CDATA[TARGETDIR = ""]]></Custom>

...

    public bool DoBack
    {
        get
        {
            MasterDetailPage mainPage = App.Current.MainPage as MasterDetailPage;

            if (mainPage != null)
            {    
                bool canDoBack = mainPage.Detail.Navigation.NavigationStack.Count > 1 || mainPage.IsPresented;

                // we are on a top level page and the Master menu is NOT showing
                if (!canDoBack)
                {
                    // don't exit the app just show the Master menu page
                    mainPage.IsPresented = true;
                    return false; 
                }
                else
                {
                    return true;
                }                    
            }
            return true;
        }
    }

... 我面临的问题是默认安装目录不是C:\ Program Files \ ProductName \ Client。它只是C:\ Client,我无法弄清楚原因。

1 个答案:

答案 0 :(得分:0)

尝试[ProgramFilesFolder] [制造商]并在[ProgramFilesFolder]之后跳过该反斜杠,因为MSI的文件夹属性已经有反斜杠。