编译

时间:2016-08-11 01:10:53

标签: wix

我是Wix Toolset的新手。我一直在谷歌搜索和阅读教程。我的任务是接管其他人的项目,之前没有听说过Wix。

我收到错误:

  

“产品:{C29D5782-ED4E-492C-B844-E15292A879F1}”一节中未解决的符号'WixComponentGroup:INSTALLDIR_files'的引用。

以下是我的FileFragment.wxs

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <?define SAACA_TargetDir=$(var.SAACA.TargetDir)?>
  <?define StarkBlueADFSAdapter_TargetDir=$(var.StarkBlueADFSAdapter.TargetDir)?>
  <Fragment>
    <DirectoryRef Id="INSTALLDIR">
      <Component Id="cmpABFF5E35E84AFD4197B11DE9DF2413DD" Guid="{FA545A1A-C5FA-483B-ADB0-97FFD9D64695}">
        <File Id="fil8BE63D7D0CF5F7EC0CDA9144B4383379" KeyPath="yes" Source="$(var.SourcePath)\readme.txt" />
      </Component>
      <Directory Id="dirA5528701EE26FFBF346CCE20EE8ACE99" Name="bin">
        <Component Id="cmpB0471075A3EB855663777A0FC25896C2" Guid="{665AA658-0A65-49DE-8307-EE91BC4F063D}">
          <File Id="fil2BB254C1A2D8A4E77D8C72C2103E657E" KeyPath="yes" Source="$(var.SourcePath)\bin\HtmlAgilityPack.dll" />
        </Component>
        <Component Id="cmp20D48B7FD0F784EDD0D4AF7FFE4454B4" Guid="{0FE55C4C-EDD4-4254-AF87-4E31EE07F1E4}">
          <File Id="fil2163FF814EA3BB0870CD1DD6AB64EEA0" KeyPath="yes" Source="$(var.SourcePath)\bin\Newtonsoft.Json.dll" />
        </Component>
        <Component Id="cmpB8A7273E7CF8289095FD4A3D8C0F9BCB" Guid="{7A68B365-6E07-47A2-A481-BD9B2567D259}">
          <File Id="fil84309E5E3F29680E7406EC4FFA96726F" KeyPath="yes" Source="$(var.SourcePath)\bin\StarkBlue.Sdk.dll" />
        </Component>
        <Component Id="cmp00B7D4AA03C78496A43F55741AEC459A" Guid="{9FE30795-DB22-4A5E-BB6F-52BFC7A79F9D}">
          <File Id="fil5EFEB6E94B7D336827DA980F6B37514B" KeyPath="yes" Source="$(var.SourcePath)\bin\StarkBlueADFSAdapter.dll" />
        </Component>
      </Directory>
      <Directory Id="dir93F86CB27B2DA7095C70CFE88BB9B554" Name="gac">
        <Component Id="cmpC268A2F89BED517F2C8732818BB63BB2" Guid="{366F268C-C167-4A31-885D-997444435CF4}">
          <File Id="fil131A7F37C2A80BD4F1ACEB1018E753FC" KeyPath="yes" Source="$(var.SourcePath)\gac\HtmlAgilityPack.dll" Assembly=".net" />
        </Component>
        <Component Id="cmpA2E76D3D59511C82ED3654B3325B2E32" Guid="{57589654-0D56-4F87-8583-59C310917BCC}">
          <File Id="fil0E9F401EBC5DC9D9D275E5F0D0F3DE0B" KeyPath="yes" Source="$(var.SourcePath)\gac\Newtonsoft.Json.dll" Assembly=".net" />
        </Component>
        <Component Id="cmp13E1C8F0D7F80DA38F4F15DA5C728E31" Guid="{864ABA0B-F047-48F5-BC78-927474D1B5F7}">
          <File Id="filE284DC818AD996FCC7D7808969AB2ACE" KeyPath="yes" Source="$(var.SourcePath)\gac\StarkBlueADFSAdapter.dll" Assembly=".net" />
        </Component>
      </Directory>
      <Directory Id="dir0D7D2D8D48347B01BECC2F06E2F3CA05" Name="Html">
        <Component Id="cmp5ED9631EE2A298E6BD3DFCF7A8408CC6" Guid="{296EB9EF-EA98-4F30-AB0D-37EAD3455121}">
          <File Id="fil5B40AB42B6271548DC495BCD83291822" KeyPath="yes" Source="$(var.SourcePath)\Html\adapter.html" />
        </Component>
      </Directory>
      <Directory Id="dir2F6E2DBD7872AC6D99FFD4A591D8547D" Name="Images">
        <Component Id="cmp612314B611D496B7304BF6AFC2B0164F" Guid="{D16A3092-B475-44C7-A2D4-97B474751831}">
          <File Id="filD7AE89AB76FE8AE18D43BDFECCF54745" KeyPath="yes" Source="$(var.SourcePath)\Images\301.GIF" />
        </Component>
      </Directory>
      <Directory Id="dirBC02319722C77D63C381B32042A43610" Name="Logs">
        <Component Id="cmp2228494C17EEAE93171D610BE3F01B67" Guid="{75C0314D-C552-48EA-B5F1-1866752E47B9}" KeyPath="yes">
          <CreateFolder />
        </Component>
      </Directory>
      <Directory Id="dir56A9BD95D908D4AE3D37F91AAC2444E9" Name="Props">
        <Component Id="cmp96195594B8A71C8A6C5F9496DD9D30E5" Guid="{196324C2-5AB6-4182-8A3B-232DDB4D9AEA}">
          <File Id="filB7EEC2B5C1FF1908754C768C9440CE64" KeyPath="yes" Source="$(var.SourcePath)\Props\StarkBlueProperties.txt" />
        </Component>
      </Directory>
    </DirectoryRef>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="StarkBlueAdapter">
      <ComponentRef Id="cmpABFF5E35E84AFD4197B11DE9DF2413DD" />
      <ComponentRef Id="cmpB0471075A3EB855663777A0FC25896C2" />
      <ComponentRef Id="cmp20D48B7FD0F784EDD0D4AF7FFE4454B4" />
      <ComponentRef Id="cmpB8A7273E7CF8289095FD4A3D8C0F9BCB" />
      <ComponentRef Id="cmp00B7D4AA03C78496A43F55741AEC459A" />
      <ComponentRef Id="cmpC268A2F89BED517F2C8732818BB63BB2" />
      <ComponentRef Id="cmpA2E76D3D59511C82ED3654B3325B2E32" />
      <ComponentRef Id="cmp13E1C8F0D7F80DA38F4F15DA5C728E31" />
      <ComponentRef Id="cmp5ED9631EE2A298E6BD3DFCF7A8408CC6" />
      <ComponentRef Id="cmp612314B611D496B7304BF6AFC2B0164F" />
      <ComponentRef Id="cmp2228494C17EEAE93171D610BE3F01B67" />
      <ComponentRef Id="cmp96195594B8A71C8A6C5F9496DD9D30E5" />
    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="INSTALLDIR_files" Directory="INSTALLDIR">
      <Component Id="Microsoft.Deployment.WindowsInstaller.dll" Guid="32cf1e97-fff1-4856-9399-13703f0c68dc">
        <File Id="Microsoft.Deployment.WindowsInstaller.dll" Name="Microsoft.Deployment.WindowsInstaller.dll" Source="$(var.SAACA_TargetDir)Microsoft.Deployment.WindowsInstaller.dll" />
      </Component>
      <Component Id="Newtonsoft.Json.dll" Guid="d656bde0-aea0-42da-a6f5-d38cd57f7832">
        <File Id="Newtonsoft.Json.dll" Name="Newtonsoft.Json.dll" Source="$(var.SAACA_TargetDir)Newtonsoft.Json.dll" />
      </Component>
      <Component Id="SAACA.dll" Guid="67ad9f71-24ca-4f98-a1cc-f40f2ba3075f">
        <File Id="SAACA.dll" Name="SAACA.dll" Source="$(var.SAACA_TargetDir)SAACA.dll" />
      </Component>
      <Component Id="Microsoft.IdentityServer.Web.dll" Guid="73611dd3-3dfb-4dd7-9d69-a581b02417b2">
        <File Id="Microsoft.IdentityServer.Web.dll" Name="Microsoft.IdentityServer.Web.dll" Source="$(var.StarkBlueADFSAdapter_TargetDir)Microsoft.IdentityServer.Web.dll" />
      </Component>
      <Component Id="SAACA.pdb" Guid="c647afe6-ef7e-4522-aab1-dda437279fb9">
        <File Id="SAACA.pdb" Name="SAACA.pdb" Source="$(var.SAACA_TargetDir)SAACA.pdb" />
      </Component>
      <Component Id="CustomAction.config" Guid="f7632128-e1b1-4dcb-ae10-1f646df90147">
        <File Id="CustomAction.config" Name="CustomAction.config" Source="$(var.SAACA_TargetDir)CustomAction.config" />
      </Component>
      <Component Id="HtmlAgilityPack.dll" Guid="308bb776-597e-4069-8ede-6a9e1107eabc">
        <File Id="HtmlAgilityPack.dll" Name="HtmlAgilityPack.dll" Source="$(var.StarkBlueADFSAdapter_TargetDir)HtmlAgilityPack.dll" />
      </Component>
      <Component Id="StarkBlue.Sdk.dll" Guid="9276faf8-9157-4948-9134-b7eac1bc590e">
        <File Id="StarkBlue.Sdk.dll" Name="StarkBlue.Sdk.dll" Source="$(var.StarkBlueADFSAdapter_TargetDir)StarkBlue.Sdk.dll" />
      </Component>
      <Component Id="StarkBlueADFSAdapter.pdb" Guid="ac729a7f-fe62-465e-8d49-af938698b808">
        <File Id="StarkBlueADFSAdapter.pdb" Name="StarkBlueADFSAdapter.pdb" Source="$(var.StarkBlueADFSAdapter_TargetDir)StarkBlueADFSAdapter.pdb" />
      </Component>
      <Component Id="StarkBlueADFSAdapter.dll" Guid="6c36f588-846b-43f8-a17b-b0d58f5dd764">
        <File Id="StarkBlueADFSAdapter.dll" Name="StarkBlueADFSAdapter.dll" Source="$(var.StarkBlueADFSAdapter_TargetDir)StarkBlueADFSAdapter.dll" />
      </Component>
    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="Resources_Images_files" Directory="Resources_Images">
      <Component Id="Resources_Images_HelpDesk.png" Guid="761b57c7-3db9-4f51-a03d-6ec1130e3184">
        <File Id="Resources_Images_HelpDesk.png" Name="HelpDesk.png" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\Images\HelpDesk.png" />
      </Component>
      <Component Id="Resources_Images_OATH.png" Guid="28627250-524a-4f4b-a93b-66ea7aee9edf">
        <File Id="Resources_Images_OATH.png" Name="OATH.png" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\Images\OATH.png" />
      </Component>
      <Component Id="Resources_Images_Email.png" Guid="9dc0d4a9-fd8e-461a-acc6-ac8e533d3814">
        <File Id="Resources_Images_Email.png" Name="Email.png" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\Images\Email.png" />
      </Component>
      <Component Id="Resources_Images_301.GIF" Guid="a8127906-7582-43f7-bba1-fce87a877250">
        <File Id="Resources_Images_301.GIF" Name="301.GIF" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\Images\301.GIF" />
      </Component>
      <Component Id="Resources_Images_KBQ.png" Guid="db5e896a-754b-4d69-8b30-eb85e499c6ff">
        <File Id="Resources_Images_KBQ.png" Name="KBQ.png" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\Images\KBQ.png" />
      </Component>
      <Component Id="Resources_Images_Voice.png" Guid="7f724658-a985-4066-892e-b23e7f28f10c">
        <File Id="Resources_Images_Voice.png" Name="Voice.png" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\Images\Voice.png" />
      </Component>
      <Component Id="Resources_Images_SMS.png" Guid="ec00ce0b-6698-46f2-a1ea-362dac803b42">
        <File Id="Resources_Images_SMS.png" Name="SMS.png" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\Images\SMS.png" />
      </Component>
    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="Resources_Html_files" Directory="Resources_Html">
      <Component Id="Resources_Html_adapter.html" Guid="52cf0390-370e-45cf-aead-2da6573f1c12">
        <File Id="Resources_Html_adapter.html" Name="adapter.html" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\Html\adapter.html" />
      </Component>
    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="Resources_files" Directory="Resources">
      <Component Id="Resources_readme.txt" Guid="98690207-02bf-4b77-ba98-eb0641f1c69a">
        <File Id="Resources_readme.txt" Name="readme.txt" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\readme.txt" />
      </Component>
    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="Resources_Props_files" Directory="Resources_Props">
      <Component Id="Resources_Props_StarkBlueProperties.txt" Guid="47aea511-d28d-4efd-bde4-0440ba6429c4">
        <File Id="Resources_Props_StarkBlueProperties.txt" Name="StarkBlueProperties.txt" Source="$(var.StarkBlueADFSAdapter_TargetDir)Resources\Props\StarkBlueProperties.txt" />
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>

这是我的Product.wxs

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">

  <?define UpgradeCode="b21f4fe8-3a40-4080-9bac-22e155496c10" ?>
  <?define InfoURL="https://www.StarkBlue.com/" ?>

  <Product Id="{C29D5782-ED4E-492C-B844-E15292A879F1}" Name="!(loc.ApplicationName)" Language="!(loc.Language)" Version="1.0.0.0" Manufacturer="!(loc.Manufacture)" UpgradeCode="$(var.UpgradeCode)">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" AdminImage="yes" Manufacturer="!(loc.Manufacture)" Comments="!(loc.ProductComments)" Description="!(loc.ProductDescription)" Keywords="!(loc.ProductKeywords)" />

    <?include Settings.wxi?>

    <WixVariable Id="WixUILicenseRtf" Value="placeholder" />
    <WixVariable Id="WixUIBannerBmp" Value="Resources\BannerTop.bmp" />
    <WixVariable Id="WixUIDialogBmp" Value="Resources\Dialog.bmp" />

    <MajorUpgrade DowngradeErrorMessage="!(loc.NewerInstalled)" AllowSameVersionUpgrades="yes" />
    <MediaTemplate EmbedCab="yes" />


    <Property Id="REMADAPTERNAME" Secure="yes" />
    <Property Id="REMINSTALLDIR" Secure="yes" />
    <Property Id="REMISPRIMARY" Secure="yes" />
    <Property Id="ARPHELPLINK" Value="$(var.InfoURL)" />
    <Property Id="STOREDADAPTERNAME">
      <RegistrySearch Id="ADAPTERNAME_REGSEARCH" Root="HKLM" Key="Software\StarkBlue\ADFSAdapter" Name="AdapterName" Type="raw" Win64="no" />
    </Property>
    <Property Id="STOREDINSTALLDIR">
      <RegistrySearch Id="INSTALLDIR_REGSEARCH" Root="HKLM" Key="Software\StarkBlue\ADFSAdapter" Name="InstallDir" Type="raw" Win64="no" />
    </Property>
    <Property Id="STOREDISPRIMARY">
      <RegistrySearch Id="ISPRIMARY_REGSEARCH" Root="HKLM" Key="Software\StarkBlue\ADFSAdapter" Name="IsPrimaryADFS" Type="raw" Win64="no" />
    </Property>

    <SetProperty Id="REMADAPTERNAME" Value="[STOREDADAPTERNAME]" After="AppSearch">NOT(REMADAPTERNAME)</SetProperty>
    <SetProperty Id="REMINSTALLDIR" Value="[STOREDINSTALLDIR]" After="AppSearch">NOT(REMINSTALLDIR)</SetProperty>
    <SetProperty Id="REMISPRIMARY" Value="[STOREDISPRIMARY]" After="AppSearch">NOT(REMISPRIMARY)</SetProperty>

    <Binary Id="SAACA" SourceFile="$(var.SAACA.TargetDir)$(var.SAACA.TargetName).CA.dll" />

    <CustomAction Id="PassProperties" Property="SetProperties" Value="installDir=[INSTALLDIR];enableLogs=[ENABLELOGS];managementUiFriendlyName=[MANAGEMENTUIFRIENDLYNAME];appID=[APPID];appKey=[APPKEY];StarkBlueRealmUrl=[StarkBlueREALMURL];useSamAccountName=[USESAMACCOUNTNAME];phoneimageurl=[PHONEIMAGEURL];smsimageurl=[SMSIMAGEURL];emailimageurl=[EMAILIMAGEURL];kbqimageurl=[KBQIMAGEURL];hdimageurl=[HDIMAGEURL];oathimageurl=[OATHIMAGEURL];progressgifurl=[PROGRESSGIFURL];disablessl=[DISABLESSL]" />

    <CustomAction Id="SetProperties" BinaryKey="SAACA" DllEntry="SetProperties" Execute="deferred" Return="check" Impersonate="no" />

    <CustomAction Id="PassAssemblyNameForReg" Property="RegisterWithADFS" Value="ASSEMBLYFULLNAME=[ASSEMBLYFULLNAME];ADAPTERNAME=[ADAPTERNAME];ISPRIMARY=[ISPRIMARY]" />

    <CustomAction Id="RegisterWithADFS" BinaryKey="SAACA" DllEntry="RegisterWithADFS" Execute="deferred" Return="ignore" Impersonate="no" />

    <CustomAction Id="PassAssemblyNameForUnreg" Property="UnregisterWithADFS" Value="ASSEMBLYFULLNAME=[ASSEMBLYFULLNAME];ADAPTERNAME=[STOREDADAPTERNAME];ISPRIMARY=[STOREDISPRIMARY]" />

    <CustomAction Id="UnregisterWithADFS" BinaryKey="SAACA" DllEntry="UnregisterWithADFS" Execute="deferred" Return="ignore" Impersonate="no" />

    <CustomAction Id="PassInstallDirToRemove" Property="RemoveExtraFilesFolders" Value="installDir=[REMINSTALLDIR]" />

    <CustomAction Id="RemoveExtraFilesFolders" BinaryKey="SAACA" DllEntry="RemoveExtraFilesFolders" Execute="deferred" Return="ignore" Impersonate="no" />

    <PropertyRef Id="NETFRAMEWORK45" />

    <Condition Message="!(loc.DotNetFrameworkNeeded)">
      <![CDATA[Installed OR NETFRAMEWORK45]]>
    </Condition>

    <Condition Message="!(loc.OSVersion)">
      <![CDATA[Installed OR (VersionNT >= 601)]]>
    </Condition>

    <InstallExecuteSequence>
      <InstallExecute After="MsiPublishAssemblies" />
      <Custom Action="PassProperties" Before="InstallFinalize">
        NOT Installed
      </Custom>
      <Custom Action="SetProperties" After="PassProperties">
        NOT Installed
      </Custom>
      <Custom Action="PassAssemblyNameForReg" Before="RegisterWithADFS">
        NOT INSTALLED
      </Custom>
      <Custom Action="RegisterWithADFS" Before="InstallFinalize">
        NOT Installed
      </Custom>
      <Custom Action="PassAssemblyNameForUnreg" Before="RemoveRegistryValues">
        Installed
      </Custom>
      <Custom Action="UnregisterWithADFS" Before="InstallFinalize">
        Installed
      </Custom>
      <Custom Action="PassInstallDirToRemove" Before="RemoveRegistryValues">
        Installed
      </Custom>
      <Custom Action="RemoveExtraFilesFolders" Before="InstallFinalize">
        Installed
      </Custom>
    </InstallExecuteSequence>

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="WindowsFolder" Name="WindowsFolder">
        <Directory Id="ADFSFolder" Name="ADFS">
          <Directory Id="INSTALLDIR" Name="StarkBlueAdapter">
            <Component Id="SetRegSettings" Guid="7BAE916D-FE70-40B2-AD44-6D8A551643EA">
              <RegistryKey Root="HKLM" Key="Software\StarkBlue\ADFSAdapter">
                <RegistryValue Type="string" Name="InstallDir" Value="[INSTALLDIR]" KeyPath="yes" />
                <RegistryValue Type="string" Name="AdapterName" Value="[ADAPTERNAME]" />
                <RegistryValue Type="string" Name="IsPrimaryADFS" Value="[ISPRIMARY]" />
              </RegistryKey>
            </Component>
          </Directory>
          <Directory Id="Resources" Name="Resources">
            <Directory Id="Resources_Html" Name="Html" />
            <Directory Id="Resources_Images" Name="Images" />
            <Directory Id="Resources_Props" Name="Props" />
          </Directory>
        </Directory>
      </Directory>
    </Directory>

    <Feature Id="ProductFeature" Title="StarkBlue TwoFacto Adapter" Level="1" ConfigurableDirectory="INSTALLDIR">
      <ComponentGroupRef Id="StarkBlueAdapter" />
      <ComponentRef Id="SetRegSettings" />
      <ComponentGroupRef Id="INSTALLDIR_files" />
    </Feature>

    <UI>
      <UIRef Id="WixUI_SAUI" />
    </UI>


  </Product>
</Wix>

我正在努力为自己做一个速成课程,并尝试解决这个问题。

0 个答案:

没有答案