2014-03-19 108 views
1

在應用程序中,32位或64位沒有單獨的依賴關係。這是一個常見的WPF應用程序,我沒有使用任何第三方.dll。如果我拉釋放文件夾文件,並在Win 8.1 64位運行它的工作。 當我試圖在安裝後運行應用程序時,我使用Wix 3.8來製作安裝程序。Win 32應用程序未在Win 64位操作系統中啓動

這裏有什麼我這樣做,爲的步驟: VS 2012配置管理: 調試: enter image description here

發佈: enter image description here

PrintUtility is the exe of the applicaiton.

PrintUtilityExe is the BootStrapper of WIX.

SetupProjectInstaller is the .msi installer of WIX.

當我通過WIX:SetupProjectInstaller.msi製作安裝程序並將其安裝在Win 64位8.1上時,應用程序未啓動。

這裏是維克斯代碼:Product.wxs

<?xml version="1.0"?> 
<?define ProductVersion = "1.0.0.0"?> 
<?define ProductUpgradeCode = "9fe100b5-8486-46c4-b3ab-15da1931ba4d"?> 
<?define SourceDir = "C:\Users\krangaraj\Documents\Visual Studio 2012\Projects\TestPrintUtility\TestPrintUtility\bin\x86\Release" ?> 
<?define SourceDirImages = "C:\Users\krangaraj\Documents\Visual Studio 2012\Projects\TestPrintUtility\TestPrintUtility\bin\x86\Release\Res" ?> 

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="*" UpgradeCode="$(var.ProductUpgradeCode)" 
      Name="TestPrint Utility" Version="$(var.ProductVersion)" Manufacturer="TTT" Language="1033" > 
    <Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package" InstallScope="perMachine"/> 
    <Media Id="1" Cabinet="TestPrintUtility.cab" EmbedCab="yes"/> 
    <Icon Id="ProductIcon" SourceFile="TestPrintInstaller.ico"/> 
    <Icon Id="TestPrintInstaller.ico" SourceFile="TestPrintInstaller.ico"/> 
    <Property Id="ARPPRODUCTICON" Value="TestPrintInstaller.ico" /> 
    <Upgrade Id="$(var.ProductUpgradeCode)"> 
     <UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/> 
     <UpgradeVersion Minimum="0.0.0" Maximum="$(var.ProductVersion)" IncludeMinimum="yes" IncludeMaximum="no" 
         Property="OLDERVERSIONBEINGUPGRADED"/> 
    </Upgrade> 
    <Condition Message="A newer version of this software is already installed.">NOT NEWERVERSIONDETECTED</Condition> 

    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="ProgramFilesFolder"> 
     <Directory Id="INSTALLDIR" Name="TestPrint Utility"> 

      <Component Id="TestPrintUtility" Guid="{47D7C69E-81C2-4FD6-B77B-790FBF5F7B39}"> 
      <File Id="TestPrintUtility.exe" Source="$(var.SourceDir)\TestPrintUtility.exe" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="bGround.png" Guid="{64AE1DAD-2502-4171-AF80-A153D59D8996}"> 
      <File Id="bGround.png" Source="$(var.SourceDir)\bGround.png" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="cspstat.dll" Guid="{69CAD367-A9D1-46E7-B8BA-CF839D034175}"> 
      <File Id="cspstat.dll" Source="$(var.SourceDir)\cspstat.dll" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="TTT.I18N.dll" Guid="{B20D2708-0422-4617-815F-C9143A75833F}"> 
      <File Id="TTT.I18N.dll" Source="$(var.SourceDir)\TTT.I18N.dll" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="TTTDongleManage.dll" Guid="{B4A38CE6-C34E-4391-9DCA-A142DB3BCA66}"> 
      <File Id="TTTDongleManage.dll" Source="$(var.SourceDir)\TTTDongleManage.dll" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="HtmlAgilityPack.dll" Guid="{D63578BD-902A-4899-A0BF-C82146117B03}"> 
      <File Id="HtmlAgilityPack.dll" Source="$(var.SourceDir)\HtmlAgilityPack.dll" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="HtmlAgilityPack.pdb" Guid="{8CD7A15D-C92E-4F41-A097-8A06CFB01774}"> 
      <File Id="HtmlAgilityPack.pdb" Source="$(var.SourceDir)\HtmlAgilityPack.pdb" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="HtmlAgilityPack.xml" Guid="{95B2ABCB-3E8C-4824-850C-7C3D29FB814D}"> 
      <File Id="HtmlAgilityPack.xml" Source="$(var.SourceDir)\HtmlAgilityPack.xml" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="KGDLLV10.dll" Guid="{AB144098-3E3E-42AD-94A4-ED8F40E93915}"> 
      <File Id="KGDLLV10.dll" Source="$(var.SourceDir)\KGDLLV10.dll" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="Microsoft.Expression.Interactions.dll" Guid="{1EEF5A4C-B0AF-4528-8F57-80A8A62743EB}"> 
      <File Id="Microsoft.Expression.Interactions.dll" Source="$(var.SourceDir)\Microsoft.Expression.Interactions.dll" KeyPath="yes" Checksum="yes"/> 
      </Component> 
      <Component Id="Microsoft.Expression.Interactions.xml" Guid="{8D772282-693B-4B4F-8D50-BC0A74F694E1}"> 
      <File Id="Microsoft.Expression.Interactions.xml" Source="$(var.SourceDir)\Microsoft.Expression.Interactions.xml" KeyPath="yes" Checksum="yes"/> 
      </Component> 

      </Directory> 


     </Directory> 

     <Directory Id="ProgramMenuFolder"> 
     <Directory Id="ProgramMenuSubfolder" Name="TestPrint Utility"> 
      <Component Id="ApplicationShortcuts" Guid="12345678-1234-1234-1234-333333333333"> 
      <Shortcut Id="ApplicationShortcut1" Name="TestPrint Utility" Description="TestPrint Utility" 
         Target="[INSTALLDIR]TestPrintUtility.exe" WorkingDirectory="INSTALLDIR"/> 

      <RegistryValue Root="HKCU" Key="Software\TTT PIE\TestPrintUtility" 
         Name="installed" Type="integer" Value="1" KeyPath="yes"/> 
      <RemoveFolder Id="ProgramMenuSubfolder" On="uninstall"/> 
      </Component> 

     </Directory> 
     </Directory> 

     <Directory Id="DesktopFolder" Name="Desktop"> 
     <Component Id="ApplicationShortcutDesktop" Guid="{C80E4373-F31A-4A2E-90A5-F3E2EFD149AA}"> 
      <Shortcut Id="ApplicationDesktopShortcut" 
      Name="TestPrint Utility" 
      Description="TestPrint Utility" 
      Target="[INSTALLDIR]TestPrintUtility.exe" 
      WorkingDirectory="INSTALLDIR"/> 
      <RemoveFolder Id="DesktopFolder" On="uninstall"/> 
      <RegistryValue 
      Root="HKCU" 
      Key="Software/MyAppName" 
      Name="installed" 
      Type="integer" 
      Value="1" 
      KeyPath="yes"/> 
     </Component> 
     </Directory> 


    </Directory> 


    <InstallExecuteSequence> 
     <RemoveExistingProducts After="InstallValidate"/> 

    </InstallExecuteSequence> 

    <Feature Id="DefaultFeature" Level="1"> 
     <ComponentRef Id="TestPrintUtility"/> 
     <ComponentRef Id="bGround.png"/> 
     <ComponentRef Id="cspstat.dll"/> 
     <ComponentRef Id="TTT.I18N.dll"/> 
     <ComponentRef Id="TTTDongleManage.dll"/> 
     <ComponentRef Id="HtmlAgilityPack.dll"/> 
     <ComponentRef Id="HtmlAgilityPack.pdb"/> 
     <ComponentRef Id="HtmlAgilityPack.xml"/> 
     <ComponentRef Id="KGDLLV10.dll"/> 
     <ComponentRef Id="Microsoft.Expression.Interactions.dll"/> 
     <ComponentRef Id="Microsoft.Expression.Interactions.xml"/> 



    </Feature> 


    </Product> 
</Wix> 

注:To minimize it i removed some part of comportment code from the above lines

然後我用這最後一塊代碼,以使最終的.msi:

set WIX_BIN=C:\Program Files\WiX Toolset v3.8\bin\ 
echo Wix Toolset Bin Path: %WIX_BIN% 
"%WIX_BIN%candle.exe" Product.wxs -ext WixUtilExtension 
if exist Product.wixobj ("%WIX_BIN%light.exe" -out Product.msi Product.wixobj -ext WixUIExtension -ext WixUtilExtension) 

這裏SetupProjectInstaller.wixproj代碼:

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform> 
    <ProductVersion>3.8</ProductVersion> 
    <ProjectGuid>f5d8db53-64db-41d7-9cf9-fb9a151fd45b</ProjectGuid> 
    <SchemaVersion>2.0</SchemaVersion> 
    <OutputName>SetupProjectInstaller</OutputName> 
    <OutputType>Package</OutputType> 
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath> 
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 
    <OutputPath>bin\$(Configuration)\</OutputPath> 
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> 
    <DefineConstants>Debug</DefineConstants> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 
    <OutputPath>bin\$(Configuration)\</OutputPath> 
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> 
    </PropertyGroup> 
    <ItemGroup> 
    <Compile Include="Product.wxs" /> 
    </ItemGroup> 
    <ItemGroup> 
    <ProjectReference Include="..\Utility\.Design\.Design.csproj"> 
     <Name>.Design</Name> 
     <Project>{58a00d29-5dc5-4b9e-a18d-6fe6d1f0c1cf}</Project> 
     <Private>True</Private> 
     <DoNotHarvest>True</DoNotHarvest> 
     <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> 
     <RefTargetDir>INSTALLFOLDER</RefTargetDir> 
    </ProjectReference> 
    <ProjectReference Include="..\Utility\Utility.csproj"> 
     <Name>Utility</Name> 
     <Project>{7316ff68-d2ba-4b9a-8d92-15e93ac7bc4e}</Project> 
     <Private>True</Private> 
     <DoNotHarvest>True</DoNotHarvest> 
     <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> 
     <RefTargetDir>INSTALLFOLDER</RefTargetDir> 
    </ProjectReference> 
    <ProjectReference Include="..\Utility\WPFSpark\WPFSpark.csproj"> 
     <Name>WPFSpark</Name> 
     <Project>{98be1309-ceb4-45ee-b4ad-28baf0570fab}</Project> 
     <Private>True</Private> 
     <DoNotHarvest>True</DoNotHarvest> 
     <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> 
     <RefTargetDir>INSTALLFOLDER</RefTargetDir> 
    </ProjectReference> 
    </ItemGroup> 
    <Import Project="$(WixTargetsPath)" /> 
    <!-- 
    To modify your build process, add your task inside one of the targets below and uncomment it. 
    Other similar extension points exist, see Wix.targets. 
    <Target Name="BeforeBuild"> 
    </Target> 
    <Target Name="AfterBuild"> 
    </Target> 
    --> 
</Project> 

請幫我,我如何使它在Win 64位操作系統上工作。非常感謝你。

SS: [此處輸入圖像的描述] [3]

[此處輸入圖像的描述] [4] [此處輸入圖像的描述] [5]

編輯:!

最後我把我的項目移到了Windows 8 OS 64位上的VS2012。當我在VS &中啓動項目時,它工作正常。

在我的理解中,我在配置方面和WIX方面都犯了一些錯誤。任何幫助傢伙? Note: The application can be installed on Win 32 without any problem.

+0

您是否檢查過事件日誌以確保沒有錯誤消息? –

+0

@Lukas Kubis:應用程序&.net運行時錯誤。 C:/ WINDOWS \ SYSTEM32 \ KERNELBASE.dll。 .net框架工作v4.0.30319 – linguini

+0

@NETscape:我已經添加了SS ..好像有一個KERNELBASE.dll&.net框架的問題 – linguini

回答

0

當你創建一個32位MSI(編譯爲86),然後嘗試在64位操作系統上安裝它,註冊表項將被寫入到WOW64蜂巢(HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \微軟)。在查找自定義註冊表項時,64位版本的Windows在64位註冊表配置單元中查找,而不是在WOW64註冊表配置單元中查找。在你的WIX腳本中,我看到有幾個註冊表項被設置,可能會進入WOW64配置單元,這可能是你的應用程序運行不正常的可能原因。如果最終部署到32位和64位操作系統,一種解決方案是在x86和x64上構建MSI。

+0

能否請您詳細解釋一下這個'一個解決方案是建立在MSI x86和x64的,如果它終於得到部署到32位和64位OS.' – linguini

+0

的http:// alekdavis。 blogspot.com/2011/05/build-32-and-64-bit-installers-using.html – Isaiah4110

+0

檢查此答案以及:http://stackoverflow.com/a/577793/1766402 – Isaiah4110

相關問題