WiX - 安装先决条件和第 3 方应用程序 [英] WiX - Install Prerequisites and 3rd party applications

查看:29
本文介绍了WiX - 安装先决条件和第 3 方应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 C# 应用程序有一个 wix Windows 安装程序.一切正常,我可以安装和卸载应用程序.但是我几乎没有先决条件和其他 3rd 方应用程序要与我的应用程序一起安装.

I have a wix Windows Installer for my C# application. Things are working, I am able to install and uninstall the application. But I have few Prerequisites and other 3rd party applications that I want to install with my application.

先决条件:

  1. Microsoft .NET Framework 4(x86 和 x64)-dotNetFx40_Full_x86_x64.exe
  2. SQL Server 2008 Express
  1. Microsoft .NET Framework 4 (x86 and x64) - dotNetFx40_Full_x86_x64.exe
  2. SQL Server 2008 Express
  1. SQLEXPR_x64_ENU.EXE
  2. SQLEXPR32_x86_ENU.EXE

  • SQL Server Compact 3.5 SP2

  • SQL Server Compact 3.5 SP2

    1. SSCERuntime-ENU.msi
    2. SSCERuntime-ENU-x64.msi

  • 第三方申请:

    1. TeamViewer - TeamViewer_Setup.exe

    当然,我不是在为所有先决条件和 3rd 方应用程序寻找完整的指南.我只需要你们帮助弄清楚我如何将这些 exemsi 设置嵌入到我的 wix 安装中.

    So of-course I am not looking for complete guidelines for all the Prerequisites and 3rd party applications. I just need you folks help on figuring out on how exactly I can embed these exe and msi setups to be a part of my wix installation.

    此外,有些是针对 x64 的,有些是针对 x86 的,所以它应该有足够的能力来处理操作系统版本和架构.这将如何通过 wix 实现.

    Also, some are for x64 and some are for x86, so it should be capable enough to handle the OS version and architecture. How will this be accomplished with wix.

    我已经在互联网上搜索了一段时间,但似乎没有任何具体的东西对我有用.

    I have been searching on internet for a while now and nothing concrete seems to be working for me.

    我需要确保如果没有安装这些应用程序,那么软件也不应该安装.此外,如果任何先决条件或第 3 方应用程序已安装,则不应再次安装.

    I need to make sure that if these applications are not installed then the software should also not install. Along with that if any of the prerequisite or 3rd party application is already installed then it should not install again.

    我想这可以使用一些 wix 工具来完成,但我无法获得有关操作方法的任何具体说明.

    I guess this can be done using some wix tools but I am not able to get any concrete instructions on howto.

    编辑 1

    好的,我已经安装了 Microsoft .NET Framework 4(x86 和 x64),我现在面临的问题是我无法安装 SQL Server Compact 3.5 SP2.我正在一件一件地做事情,让事情对我来说更清楚.下面我将分享我的代码,以便大家可以查看:

    Ok I have got the Microsoft .NET Framework 4 (x86 and x64) installed, and the problem which I am facing now is I am unable to install SQL Server Compact 3.5 SP2. I am doing things one by one to make things more clear to me. Here under I am sharing my code so that you people can review:

    <?xml version="1.0" encoding="UTF-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
       xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
    <Bundle Name="Bootstrapper" Version="1.0.0.0" Manufacturer="Billy"
            UpgradeCode="PUT-GUID-HERE">
      <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
      <Chain>
    
        <PackageGroupRef Id="Netfx4Full"/>
        <PackageGroupRef Id="SQLExpressCE"/>
    
        <!-- Install Application -->
        <MsiPackage Id="MyApplication" SourceFile="$(var.Installer.TargetPath)"/>
    
      </Chain>
    </Bundle>
    
    <Fragment>
      <!-- Check for .NET 4.0 -->
      <util:RegistrySearch Root="HKLM"
                           Key="SOFTWAREMicrosoftNet Framework SetupNDPv4Full"
                           Value="Version"
                           Variable="Netfx4FullVersion" />
      <util:RegistrySearch Root="HKLM"
                           Key="SOFTWAREMicrosoftNet Framework SetupNDPv4Full"
                           Value="Version"
                           Variable="Netfx4x64FullVersion"
                           Win64="yes" />
    
      <!-- Install .NEt 4.0 -->
      <PackageGroup Id="Netfx4Full">
        <ExePackage Id="Netfx4Full"
                    DisplayName="Microsoft .NET Framework 4.0"
                    Compressed="no"
                    Cache="yes"
                    PerMachine="yes"
                    Permanent="yes"
                    Protocol="netfx4"
                    Vital="yes"
                    SourceFile=".prerequisitesdotNetFx40_Full_x86_x64.exe"
                    InstallCommand="/passive /norestart"
                    DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
      </PackageGroup>
    
      <!-- Install SQL Server CE -->
      <PackageGroup Id="SQLExpressCE">
        <MsiPackage
                  Cache="no"
                  Compressed="no"
                  ForcePerMachine="yes"
                  Permanent="yes"
                  Vital="yes"
                  SourceFile=".prerequisitesSSCERuntime-ENU.msi"
                  InstallCondition="NOT VersionNT64 AND SqlInstance AND SqlServerInstalled AND SQLServer2008R2Installed" />
        <MsiPackage
                  Cache="no"
                  Compressed="no"
                  ForcePerMachine="yes"
                  Permanent="yes"
                  Vital="yes"
                  SourceFile=".prerequisitesSSCERuntime-ENU-x64.msi"
                  InstallCondition="VersionNT64 AND NOT SqlInstance AND SqlServerInstalled AND SQLServer2008R2Installed" />
      </PackageGroup>
    
    </Fragment>
    </Wix>
    

    注意:以上代码安装了.NET Framework,而不是安装SQL Server Compact 3.5 SP2

    NOTE: The above code installs .NET Framework, its not installing SQL Server Compact 3.5 SP2

    编辑 -2

    参考 Tom Blodget 回答后,我已经到了这一步,但是我无法理解如何为我的 SQL Exe 包提供安装命令,对于我的 MSI 包也是如此.我也浏览了 https://stackoverflow.com/a/19010097/1182021 Mr.Neil Sleightholm 但这是针对 SQL 2012 的,我如何使用 SQL 2008 ServerCE(条件和步骤)

    After Referring Tom Blodget answer I have reached to this far, however I am unable to understand how to give the Install Command for my SQL Exe package and same for my MSI package. I have also gone through this answer https://stackoverflow.com/a/19010097/1182021 of Mr. Neil Sleightholm but this one is for SQL 2012, how can I do this same thing with SQL 2008 Server and CE (The conditions and steps)

    <PackageGroup Id="SQLExpressCE">
      <ExePackage
                Cache="no"
                Compressed="no"
                Permanent="no"
                Vital="yes"
                InstallCommand="/QS /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS /BROWSERSVCSTARTUPTYPE=Automatic /SQLSVCSTARTUPTYPE=Automatic /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT=&quot;NT AUTHORITYNetwork Service&quot; /SQLSYSADMINACCOUNTS=&quot;BUILTINADMINISTRATORS&quot; /AGTSVCACCOUNT=&quot;NT AUTHORITYNetwork Service&quot; /SECURITYMODE=SQL /SAPWD=&quot;wegamed&quot;"
                SourceFile=".prerequisitesSQLEXPR32_x86_ENU.EXE"
                DownloadUrl="http://download.microsoft.com/download/D/1/8/D1869DEC-2638-4854-81B7-0F37455F35EA/SQLEXPR_x86_ENU.exe"
                InstallCondition="NOT SQLServer2008R2Installed AND NOT SQLServerInstalled" />
      <ExePackage DetectCondition="VersionNT64"
                Cache="no"
                Compressed="no"
                Permanent="no"
                Vital="yes"
                InstallCommand="/QS /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS /BROWSERSVCSTARTUPTYPE=Automatic /SQLSVCSTARTUPTYPE=Automatic /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT=&quot;NT AUTHORITYNetwork Service&quot; /SQLSYSADMINACCOUNTS=&quot;BUILTINADMINISTRATORS&quot; /AGTSVCACCOUNT=&quot;NT AUTHORITYNetwork Service&quot; /SECURITYMODE=SQL /SAPWD=&quot;wegamed&quot;"
                SourceFile=".prerequisitesSQLEXPR_x64_ENU.EXE"
                DownloadUrl="http://download.microsoft.com/download/D/1/8/D1869DEC-2638-4854-81B7-0F37455F35EA/SQLEXPR_x86_ENU.exe"
                InstallCondition="NOT SQLServer2008R2Installed AND NOT SQLServerInstalled" />
    </PackageGroup>
    

    但是安装程序无法完成.我想这是因为安装命令在接受许可协议之前一直有效.

    But Setup is unable to complete. I guess it is because of the install commands as it works till accept licence agreement.

    推荐答案

    请参阅 WiX 3.7 文档Building Installation Package Bundles".如果您使用 MSBuild、SharpDevelop 或 Visual Studio(非 Express),则可以使用 WiX Bootstrapper 项目模板.如果您更喜欢自己调用工具集命令行工具,它们就像构建 MSI 文件一样.

    See the WiX 3.7 docs on "Building Installation Package Bundles". If you are using MSBuild, SharpDevelop or Visual Studio (non-Express), you can use the WiX Bootstrapper project template. If you prefer to call the toolset command-line tools yourself, they are candle and light, just like for building MSI files.

    请参阅有关如何:使用 Burn 安装 .NET Framework"的 WiX 3.7 文档.注意:WiX 为 .NET 4.0 提供了两个预定义的包,都在安装时从 Microsoft 下载.一个是完整包,另一个是用户系统需要下载的下载器包.如果您不想让您的安装程序依赖 Internet 访问,您可以编写自己的包,因为您必须处理捆绑的任意 exe.显然,WiX 源代码可以帮助处理 .NET 4.0 包,因为它具有您需要的检测条件、安装命令和卸载命令.

    See the WiX 3.7 docs on "How To: Install the .NET Framework Using Burn". Note: WiX offers two pre-defined packages for .NET 4.0, both download from Microsoft at install-time. One is the full package, the other is the downloader package that downloads just is needed on the user's system. If you'd rather not have your installer depend on Internet access, you can write your own package as you have to do with any arbitrary exe that you bundle. Obviously, the WiX source code can help with the .NET 4.0 packages as it has the detect condition, install command, and uninstall command that you'd need.

    请参阅其他每个软件包的安装文档,以了解您应该将哪些内容放入它们的检测条件、安装命令和卸载命令中.而且,您还可以选择是否在每个包中放置下载 URL.

    See the installation docs for each of the other packages to find out what you should put into their detect conditions, install commands, and uninstall commands. And, again, you'd have the choice of putting a download URL in each package or not.

    <PackageGroup Id="SQLExpressCE">
        <!-- Per http://support.microsoft.com/kb/974247, on a 64-bit system both 32-bit and 64-bit packages must be installed and be the same version. -->
        <MsiPackage
              Visible="yes"
              Cache="no"
              Compressed="no"
              ForcePerMachine="yes"
              Permanent="yes"
              Vital="yes"
              SourceFile=".prerequisitesSSCERuntime-ENU.msi" />
        <MsiPackage
              Visible="yes"
              Cache="no"
              Compressed="no"
              ForcePerMachine="yes"
              Permanent="yes"
              Vital="yes"
              SourceFile=".prerequisitesSSCERuntime-ENU-x64.msi"
              InstallCondition="VersionNT64" />
    </PackageGroup>
    

    WiX 刻录故障排除

    Burn 会为其自身以及它运行的任何 MsiPackages 创建一个日志文件.检查您的 %TEMP% 文件夹.

    WiX Burn Troubleshooting

    Burn creates a log file for itself as well as any MsiPackages it runs. Check your %TEMP% folder.

    这篇关于WiX - 安装先决条件和第 3 方应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆