简体   繁体   English

如何在MSI中运行exe?

[英]How to run exe inside msi?

Kind time of the day! 一天的美好时光! I'm working on creating an msi installer using the wix toolkit. 我正在使用wix工具包创建一个msi安装程序。 It was required to run exe from under the msi installer. 需要从msi安装程序下运行exe。 Here is my code: 这是我的代码:

<Binary Id="JDK_EXE" src="..\..\jdk\jdk-6u45-windows-i586.exe"/>

<CustomAction Id="RunJavaJDKInstall"
              BinaryKey="JDK_EXE"
              ExeCommand="" 
              Return="check"/>
<InstallExecuteSequence>
  <Custom Action ="RunJavaJDKInstall" After="InstallInitialize"></Custom>
</InstallExecuteSequence>

The question is what to write in the ExeCommand tag to run jdk-6u45-windows-i586.exe on execution? 问题是在ExeCommand标记中写什么以在执行时运行jdk-6u45-windows-i586.exe?

You cant make in msı project but you can make it with wix bootstrapper project like this. 您不能在msı项目中进行创建,但可以使用wix bootstrapper项目来进行创建。

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />

   <util:RegistrySearch Root="HKLM"
                     Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                     Value="Version"
                     Variable="Netfx4FullVersion" />
  <util:RegistrySearch Root="HKLM"
                     Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                     Value="Version"
                     Variable="Netfx4x64FullVersion"
                     Win64="yes" />
<Chain>


    <!--   <PackageGroupRef Id="Net47"/>-->   
    <ExePackage Id="Net45" Name="Microsoft .NET Framework 4.5.1 Setup" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes" InstallCommand="/q"
    SourceFile=".\prerequisites\NNDP47-KB3186497-x86-x64-AllOS-ENU.exe"
    DetectCondition="(Net4FullVersion = &quot;4.5.50938&quot;) AND (NOT VersionNT64 OR (Net4x64FullVersion = &quot;4.5.50938&quot;))"
    InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Net4FullVersion = &quot;4.5.50938&quot; OR Net4x64FullVersion = &quot;4.5.50938&quot;))"/>

  <ExePackage Id="Netfx4Full"
              DisplayName="Microsoft .NET Framework 4.0"
              Compressed="yes"
              Cache="yes"
              PerMachine="yes"
              Permanent="yes"
              Protocol="netfx4"
              Vital="yes"
              SourceFile=".\prerequisites\NNDP47-KB3186497-x86-x64-AllOS-ENU.exe"
              InstallCommand="/passive /norestart"
              DetectCondition="(Net4FullVersion = &quot;4.5.50938&quot;) AND (NOT VersionNT64 OR (Net4x64FullVersion = &quot;4.5.50938&quot;))"
              InstallCondition="(VersionNT &lt; v6.0 OR VersionNT64 &lt; v6.0) AND (NOT (Net4FullVersion OR Net4x64FullVersion))" />
  <RollbackBoundary />
          <!--   <PackageGroupRef Id="SQLExpressCE"/> Install Application  NetVersion >= 460798-->
  <MsiPackage Id="MyApplication" SourceFile="$(var.SetupProject1.TargetPath)" DisplayInternalUI="yes" Compressed="yes" Vital="yes"/>

  </Chain>
</Bundle>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM