Wix 如何在目标/安装路径末尾创建/追加应用程序文件夹名称

Wix 如何在目标/安装路径末尾创建/追加应用程序文件夹名称,wix,wix3,windows-installer,Wix,Wix3,Windows Installer,我想在目标/安装路径的末尾创建/附加应用程序文件夹名称 默认路径为“C:\CompanyName\” 在这种情况下,它也应该安装在“C:\CompanyName\AppName”中 如果用户将路径更改为“C:\Test\”(通过浏览对话框或在文本框中键入),则应在“C:\Test\AppName”中进行安装 我将Wix用户界面称为“WixUI\u InstallDir” 我还设置了属性Id=“WIXUI\u INSTALLDIR”Value=“APPPATH” 我的所有快捷方式都应该指向最终的安

我想在目标/安装路径的末尾创建/附加应用程序文件夹名称

默认路径为“C:\CompanyName\” 在这种情况下,它也应该安装在“C:\CompanyName\AppName”中

如果用户将路径更改为“C:\Test\”(通过浏览对话框或在文本框中键入),则应在“C:\Test\AppName”中进行安装

我将Wix用户界面称为“WixUI\u InstallDir”

我还设置了属性Id=“WIXUI\u INSTALLDIR”Value=“APPPATH”

我的所有快捷方式都应该指向最终的安装路径

示例代码片段:

Product.wxs

<?xml version='1.0' encoding='windows-1252'?>
 <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
    <!--- some code here --->
    <Property Id="APPPATH" Secure="yes"><![CDATA[C:\CompanyName]]></Property>
    <Property Id="WIXUI_INSTALLDIR" Value="APPPATH" />
    <Property Id="ALLUSERS">1</Property>

<!--- some code here --->
    <Directory Id='TARGETDIR' Name='SourceDir'>
        <Directory Id='ProgramFilesFolder' Name='PFiles'>
            <Directory Id='APPPATH' Name='Product_Title'>   
                  <Directory Id='ConfigurationId' Name='Configuration'>
            <!--- some code here --->
                    </Directory>        
                 </Directory>               
            </Directory>
        </Directory>

        <!--- some code here --->
     <UI Id="CustomWixUI_Mondo">
              <UIRef Id= "AppWixUI_InstallDir" /> 
              <UIRef Id="WixUI_ErrorProgressText" />                                              
    </UI>               


</Product>

1.

AppWixUI_InstallDir.wxs

<?xml version="1.0" encoding="UTF-8"?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <UI Id="AppWixUI_InstallDir">

        <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
        <Property Id="WixUI_Mode" Value="InstallDir" />

        <DialogRef Id="BrowseDlg" />
        <!-- some more code... .... -->

        <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
        <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>



        <Publish Dialog="AppInstallDirDlg" Control="InstallNoShield" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
        <Publish Dialog="AppInstallDirDlg" Control="InstallNoShield" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
        <Publish Dialog="AppInstallDirDlg" Control="InstallNoShield" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>            
        <Publish Dialog="AppInstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
        <Publish Dialog="AppInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

        <!-- some more code... .... -->

    </UI>

    <UIRef Id="WixUI_Common" />
 </Fragment>

1.
"1"]]>
1.
不是WIXUI_DONTVALIDATEPATH
"1"]]>            
1.
1.

AppInstallDirDlg.wxs

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
 <Fragment>
    <UI>
        <Dialog Id="AppInstallDirDlg" Width="370" NoMinimize = "yes" Height="270" Title="InstallDirDlg_Title">


            <Control Id="InstallNoShield" Type="PushButton" ToolTip="Next" ElevationShield="no" X="4" Y="243" Width="80" Height="17" Default="yes" Hidden="yes" Disabled="yes" Text="Next">
                <Condition Action="show">NOT Installed </Condition>
                <Condition Action="enable">NOT Installed</Condition>
                <Condition Action="default">NOT Installed</Condition>
                <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
                <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
                <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
            </Control>

            <!-- <Control Id="Next" Type="PushButton" X="4" Y="243" Width="56" Height="17" ToolTip="Next" Default="yes" Text="Next" /> -->
            <Control Id="Back" Type="PushButton" X="246" Y="243" Width="56" Height="17" ToolTip="Back" Text="Back" >
                <Publish Event="NewDialog" Value="AppLicenseAgreementDlg">1</Publish>
            </Control>
            <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" ToolTip="Cancel" Cancel="yes" Text="Cancel">
                <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
            </Control>

            <Control Id="FolderLabel" Type="Text" X="20" Y="58" Width="290" Height="15" NoPrefix="yes" Text="InstallDirDlgFolderLabel" />
            <Control Id="Folder" Type="PathEdit" X="20" Y="75" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
            <Control Id="ChangeFolder" Type="PushButton" X="20" Y="96" Width="80" Height="17" ToolTip="Change Folder" Text="InstallDirDlgChange" />
            <Control Id="DiskUsage" Type="Text" X="20" Y="128" Width="290" Height="15" NoPrefix="yes" Text="InstallDirDlgDiskUsage" />
            <Control Id="VolumeList" Type="VolumeCostList" X="20" Y="145" Width="320" Height="75" Sunken="yes" Fixed="yes" Remote="yes" Text="DiskCostDlgVolumeList" />
        </Dialog>
      </UI>
   </Fragment>
</Wix>

未安装
未安装
未安装
1]]>
OutOfDiskSpace=1,OutOfNoRbDiskSpace=0和(PROMPTROLLBACKCOST=“P”或不PROMPTROLLBACKCOST)
OutOfDiskSpace=1,OutOfNoRbDiskSpace=0,PROMPTROLLBACKCOST=“D”
OutOfDiskSpace=1,OutOfNoRbDiskSpace=0,PROMPTROLLBACKCOST=“D”
(OutOfDiskSpace=1和OutOfNoRbDiskSpace=1)或(OutOfDiskSpace=1和PROMPTROLLBACKCOST=“F”)
1.
1.

请提供任何帮助…

如果您不需要在对话框中显示文件夹MyApp,您可以执行以下操作:

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="INSTALLFOLDER" Name="CompanyName">
        <Directory Id="MyApp" Name="MyApp" />
    </Directory>
</Directory>

在组件中,用MyApp替换INSTALLFOLDER,方法如下:

<Component Id="Component_Core" Guid="*" Directory="MyApp">

作为旁注,我不建议仅仅为了显示“C:\CompanyName\MyApp”或“C:\Temp\MyApp”之类的内容而弄乱对话框。如果只显示“C:\CompanyName”或“C:\Temp”并将文件安装到MyApp文件夹中,会更容易

如果仍要显示全文,请尝试以下操作(不推荐)):


1.

谢谢马洛斯的回答。这里我有几个问题。1) 如果我们使用merge模块(使之成为我的heat命令)处理大部分文件,那么如何处理它。2) 如果我们使用WixLib(通过使用heat命令和lit命令),如何处理?3) 是否所有快捷方式仍将指向完整安装路径(即C:/Temp/MyApp)?4)并且我们有3个应用程序,因此它应指向适当的应用程序路径示例:如果用户在C:/Temp位置安装我们的3个应用程序,则最终安装路径将是App1::“C:/Temp/MyApp1”和“App2:“C:/Temp/MyApp2”。因此,所有我的注册表搜索(在安装和卸载以及主要升级过程中)都应该能够为每个应用程序正常工作。
<Property Id="INDIRECT_FOLDER" Value="MyApp" />

<Dialog Id="NewInstallDirDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
    <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
    <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
        <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
    </Control>

    <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" />
    <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
    <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
    <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
    <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />

    <Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" />
    <Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="INDIRECT_FOLDER" Indirect="yes" />
    <Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
</Dialog>