Wix & Burn - Install IIS if not yet installed

后端 未结 5 966
感动是毒
感动是毒 2020-12-30 14:08

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

5条回答
  •  轮回少年
    2020-12-30 15:03

    @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:

    Host machine information: OS Version=6.1.7600, Running architecture=x86

    Or,

    Host machine information: OS Version=6.1.7600, Running architecture=amd64

    When you try to run the 32-bit dism on and 64-bit OS, you will get this error

    Error: 11 You cannot service a running 64-bit operating system with a 32-bit version of DI SM. Please use the version of DISM that corresponds to your computer's architecture. The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

    My solution is creating another WiX installer project "InstallPrerequisites" and run the 64-bit dism with "QtExec64CmdLine" . Here is an example:

    
    
    
    

    I use answer file to include all the features, so we can enable them all at one time. And then chain the installer

    
    

    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 ----->
    

提交回复
热议问题