问题描述
我有一个使用IIS的项目,我想用Wix为它创建一个安装程序。我已成功为应用程序创建了.msi安装程序,我正在为它创建一个Bundle安装程序,它将安装必备软件并在此之后安装我的应用程序。
这是Bundle的代码:
<?xml version =1.0encoding =UTF-8?>
< Wix xmlns =http://schemas.microsoft.com/wix/2006/wi
xmlns:util =http://schemas.microsoft.com/wix/UtilExtension
xmlns:bal =http://schemas.microsoft.com/wix/BalExtension>
< Bundle Name =BootstrapperVersion =1.0.0.0Manufacturer =VilmosNagyUpgradeCode =844c755f-f02b-4dd3-8b9c-af2498f3128c>
< BootstrapperApplicationRef Id =WixStandardBootstrapperApplication.RtfLicense/>
< Chain>
< PackageGroupRef Id =NetFx45Web/>
< PackageGroupRef Id =SQLServerExpress/>
<! - < MsiPackage SourceFile =path\to\your.msi/> - >
< / Chain>
< / Bundle>
< / Wix>
我的问题是,如何安装(或启用?)IIS,如果没有安装? / p>
谢谢!
@Nagy Vilmos,你的解决方案不会在64位操作系统上工作。刻录是 32位程序。它将启动32位dism.exe,即使您希望它通过在64位操作系统上提供完整路径C:\ Windows \ System32 \ dism.exe来运行64位dism。这是由。
dism的日志会告诉你它是32位还是64位。打开文件C:\ Windows\Logs \DISM\dism.log你会发现这样的信息:
或者,
当您尝试运行32位dism和64位操作系统时,您将收到此错误
我的解决方案是创建另一个WiX安装程序项目InstallPrerequisites并使用QtExec64CmdLine运行64位dism。下面是一个示例:
<! - 1.您需要使用x64版本的quiet命令行
2.还需要[System64Folder]。如果没有,QtExec64CmdLine将找到一个32位的dism.exe来运行。
- >
< Property Id =QtExec64CmdLineValue ='[System64Folder] dism.exe/ Online /Apply-Unattend:[ProductTmpFolder]iis_unattend.xml'/>
< CustomAction Id =SilentLaunchBinaryKey =WixCADllEntry =CAQuietExec64Execute =immediateReturn =check/>
我使用答案文件包含所有功能,因此我们可以同时启用它们。然后链接安装程序
< MsiPackage DisplayName =Install PrerequisitesSourceFile =$(var.InstallPrerequisites.TargetPath) />
更新:
使用C:\ windows \ SysNative\dism.exe,我现在可以避免为x64平台单独的项目。从日志中,您可以看到32位进程现在正在运行64位DISM。
2015-10-26 16: 28:07,信息DISM DISM.EXE:< -----启动Dism.exe会话----->
2015-10-26 16:28:07,Info DISM DISM.EXE:
2015-10-26 16:28:07,Info DISM DISM.EXE:主机信息:操作系统版本= 6.1 .7601,运行架构= amd64,处理器数量= 4
2015-10-26 16:28:07,信息DISM DISM.EXE:执行命令行:C:\ windows \ SysNative \dism。 exe
2015-10-26 16:28:07,Info DISM DISM Provider Store:PID = 2000从本地提供商商店类型获取提供商的集合。 - CDISMProviderStore :: GetProviderCollection
....
2015-10-26 16:28:09,Info DISM DISM.EXE:图像会话已关闭。需要重启=否。
2015-10-26 16:28:09,Info DISM DISM.EXE:
2015-10-26 16:28:09,Info DISM DISM.EXE:< ----- Ending Dism.exe会话----->
I've a project using IIS, and I want to create an installer for it with Wix. I've created the .msi installer for the app successfully, and I'm creating a Bundle installer for it, which will install the prerequisites and after that my application.
Here's the Bundle's code:
<?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:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="Bootstrapper" Version="1.0.0.0" Manufacturer="VilmosNagy" UpgradeCode="844c755f-f02b-4dd3-8b9c-af2498f3128c">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<PackageGroupRef Id="NetFx45Web"/>
<PackageGroupRef Id="SQLServerExpress"/>
<!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
</Chain>
</Bundle>
</Wix>
My question is, how can I install (or enable?) the IIS, IF not installed?
Thanks!
@Nagy Vilmos, your solution won't work on 64-bit OS. Burn is 32-bit program. It will launch the 32-bit "dism.exe", even if you want it to run the 64-bit dism by giving full path "C:\Windows\System32\dism.exe" on 64-bit OS. That is caused by "File System Redirector".
The dism's log will tell you it's 32-bit or 64-bit. Open file "C:\Windows\Logs\DISM\dism.log" you will find information like this:
Or,
When you try to run the 32-bit dism on and 64-bit OS, you will get this error
My solution is creating another WiX installer project "InstallPrerequisites" and run the 64-bit dism with "QtExec64CmdLine" . Here is an example:
<!--1.You need to use the x64 version of quiet command line
2.[System64Folder] is also needed. If not, QtExec64CmdLine will find a 32-bit dism.exe to run.
-->
<Property Id="QtExec64CmdLine" Value='"[System64Folder]dism.exe" /Online /Apply-Unattend:[ProductTmpFolder]iis_unattend.xml'/>
<CustomAction Id="SilentLaunch" BinaryKey="WixCA" DllEntry="CAQuietExec64" Execute="immediate" Return="check" />
I use answer file to include all the features, so we can enable them all at one time. And then chain the installer
<MsiPackage DisplayName="Install Prerequisites" SourceFile="$(var.InstallPrerequisites.TargetPath)" />
Update:By using "C:\windows\SysNative\dism.exe", I can now avoid a separate project for x64 platform. From the log, you can see the 32 bit process is now running 64-bit DISM.
2015-10-26 16:28:07, Info DISM DISM.EXE: <----- Starting Dism.exe session ----->
2015-10-26 16:28:07, Info DISM DISM.EXE:
2015-10-26 16:28:07, Info DISM DISM.EXE: Host machine information: OS Version=6.1.7601, Running architecture=amd64, Number of processors=4
2015-10-26 16:28:07, Info DISM DISM.EXE: Executing command line: C:\windows\SysNative\dism.exe
2015-10-26 16:28:07, Info DISM DISM Provider Store: PID=2000 Getting the collection of providers from a local provider store type. - CDISMProviderStore::GetProviderCollection
....
2015-10-26 16:28:09, Info DISM DISM.EXE: Image session has been closed. Reboot required=no.
2015-10-26 16:28:09, Info DISM DISM.EXE:
2015-10-26 16:28:09, Info DISM DISM.EXE: <----- Ending Dism.exe session ----->
这篇关于Wix&刻录 - 如果尚未安装,请安装IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!