我创建了一个wix安装程序,它在本地机器上工作正常,但是当我尝试在另一台机器上安装它时,它最后会回滚。在安装过程中,我也可以在其他机器上看到安装的文件夹。以下是我的代码
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:iis="http://wixtoolset.org/schemas/v4/wxs/iis"
>
<!-- The name of the product -->
<?define WindowServiceName = "Gatac Window Service" ?>
<!-- The manufacturer, for setup package publisher and folder info -->
<?define Manufacturer = "GAT" ?>
<Product Id="*" Name="Time Attendance Setup" Language="1033" Version="1.0.0.0" Manufacturer="GAT" UpgradeCode="3bd1aa4d-5ff8-4f82-8e46-2dda5daec90d" >
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<!-- Prerequiest -->
<PropertyRef Id="IISMAJORVERSION"/>
<Condition Message="Install requires IIS 7 or latest.">
<![CDATA[Installed OR (IISMAJORVERSION AND (IISMAJORVERSION >= "#7" OR IISMAJORVERSION = "#10"))]]>
</Condition>
<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="This application requires .NETFramework 4.5. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition>
<!-- Prerequiest -->
<Feature Id="ProductFeature" Title="WebPortalSetup" Level="1">
<ComponentGroupRef Id="MyWebWebComponents" />
<ComponentGroupRef Id="GatWebsiteIssConfiguration" />
<ComponentRef Id='SqlComponent'/>
<ComponentRef Id="WindowsServiceHost" />
</Feature>
<!-- Specify UI -->
<UIRef Id="MyUI" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<Property Id="IISROOT">
<RegistrySearch Id="IISROOT"
Type="directory"
Root="HKLM"
Key="Software\Microsoft\InetStp"
Name="PathWWWRoot" />
</Property>
<!-- Will default to C:\ if that is the main disk-->
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- Will reference to C:\inetpub-->
<Directory Id="IISROOT" Name="WebDir">
<Directory Id="INSTALLFOLDER" Name="GATAC">
</Directory>
</Directory>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='InstallDir' Name='Acme'>
</Directory>
<Directory Id="ROOTDIRECTORY" Name="$(var.Manufacturer)">
<!--Create a folder inside Talk Sharp called Test Service-->
<Directory Id="INSTALLERFOLDER" Name="$(var.WindowServiceName)" />
</Directory>
</Directory>
</Directory>
</Product>
</Wix>