Installing SQL Server 2014 Express as a prerequisite in boostrapper

后端 未结 1 373
孤城傲影
孤城傲影 2021-01-16 11:17

I am trying to use boostrapper (Wix 3.11) to set up an installation, with SQL Server 2014 Express as a prerequisite.

It works well when I install setup.exe

相关标签:
1条回答
  • 2021-01-16 12:12

    Haven't looked at this in a while, but nobody else seems to be around right now. I'll give it a go: I guess you are using pre-processor variables in your source there, and not runtime variables. In other words the "$(var.VariableName)" entries are resolved at build-time (when your WiX Bundle is compiled - which is sometimes OK) and not at run-time (when your WiX Bundle is installed - which is often desired).

    In other words I would assume your pre-processor variables resolve to blank strings during compilation, and that is why your install does not work. There are no values specified at all for all pre-processor fields.

    As a test, maybe compile your bundle with some hard-coded values as a "smoke test", to determine if this is the case. Then try the Variable element described below.

    Mockup:

    <ExePackage Id ="SQL_express" SourceFile="SQLEXPR_x64_ENU.exe" Compressed="yes" Vital="no" InstallCommand="/q /ACTION=Install /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT=TestAccount /SQLSYSADMINACCOUNTS=SqlAccount /AGTSVCACCOUNT=SvcAccount /IACCEPTSQLSERVERLICENSETERMS /SECURITYMODE=SQL /SAPWD=SAPassword" />
    

    Maybe you can have a look at Neil Sleightholm's blog for some ideas how to approach this (I don't have a fully working sample to add): http://neilsleightholm.blogspot.com/2012/05/wix-burn-tipstricks.html

    I think the key is the Variable element:

    <Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]ACME\My App" />
    

    It looks like you can override such values at the command line by setting the Overridable attribute to yes (bottom of the page for that link). I have never tried this. It looks like these Variable elements resolve using the standard MSI-brace convention: [InstallFolder]. Sample:

    <MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" /> 
    

    See Sleightholm's template again for full context for the above fragments. You will be using an ExePackage instead of an MsiPackage obviously.

    It appears you can ignore the WixVariable element for your use-case (as opposed to the Variable element which you will need).

    0 讨论(0)
提交回复
热议问题