WiX DetectCondition в пакете - PullRequest
       108

WiX DetectCondition в пакете

0 голосов
/ 03 августа 2020

Я пытаюсь установить SQL Сервер Express в зависимости от предыдущей установки. Если конкретный экземпляр c уже установлен, он должен показать мне варианты восстановления / удаления. Если указанный c экземпляр не установлен, он должен начать установку.

Независимо от того, что я делаю, он не может найти установленный экземпляр.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

  <!--Instance name is limited to 16 characters-->
  <?define SqlInstanceName=XXX?>
  <?define SqlInstallCommand=/ACTION=Install /Q /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQL,Tools /UpdateEnabled=0 /HIDECONSOLE /SECURITYMODE=SQL /SAPWD="thisisapass" /NPENABLED=1 /TCPENABLED=1 /BROWSERSVCStartupType=2 /ENABLERANU=True /ADDCURRENTUSERASSQLADMIN="True" /SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS" /AGTSVCACCOUNT="NT AUTHORITY\Network Service" /UpdateEnabled="False" ?>
  <?define SqlUninstallCommand=/ACTION=Uninstall /Q /FEATURES=SQL,Tools /INSTANCENAME=$(var.SqlInstanceName) ?>
  <?define SqlRepairCommand=/ACTION=Repair /Q /FEATURES=SQL,Tools /INSTANCENAME=$(var.SqlInstanceName) ?>
  
    <Fragment>
        <!-- TODO: Put your code here. -->
    <util:RegistrySearch Id="regsearchSqlInstanceFoundx64" 
                         Root="HKLM"
                         Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
                         Value="$(var.SqlInstanceName)"
                         Result="exists"
                         Variable="SqlInstanceFoundx64"
                         Win64="yes" />
    <util:RegistrySearch Id="regsearchSqlInstanceFoundx86"
                     Root="HKLM"
                     Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
                     Value="$(var.SqlInstanceName)"
                     Result="exists"
                     Variable="SqlInstanceFoundx86" />

    <PackageGroup Id="SqlServerPackageGroup">
      <ExePackage SourceFile="SQLEXPR_x64_ENU.exe" 
                  DetectCondition="SqlInstanceFoundx64 OR SqlInstanceFoundx86"
                  DisplayName="Installing SQL Server Express 2019"
                  PerMachine="yes"
                  Compressed="yes"
                  InstallCommand="$(var.SqlInstallCommand)"
                  UninstallCommand="$(var.SqlUninstallCommand)"
                  RepairCommand="$(var.SqlRepairCommand)"></ExePackage>
    </PackageGroup>
    </Fragment>
</Wix>

Экран моего Regedit

[0C80:2190][2020-08-03T13:44:54]i001: Burn v3.11.1.2318, Windows v10.0 (Build 17763: Service Pack 0), path: C:\Users\USER~1.DOMAIN-\AppData\Local\Temp\{21E02EDC-2541-4DA5-A54E-AFDB6E5F653A}\.cr\SqlServerBootstrapper.exe
[0C80:2190][2020-08-03T13:44:54]i009: Command Line: '-burn.clean.room=C:\Users\user.name.DOMAIN\Desktop\SqlServerBootstrapper.exe -burn.filehandle.attached=632 -burn.filehandle.self=640'
[0C80:2190][2020-08-03T13:44:54]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\user.name.DOMAIN\Desktop\SqlServerBootstrapper.exe'
[0C80:2190][2020-08-03T13:44:54]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\user.name.DOMAIN\Desktop\'
[0C80:2190][2020-08-03T13:44:58]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\USER~1.DOMAIN-\AppData\Local\Temp\SqlServerBootstrapper_20200803134458.log'
[0C80:2190][2020-08-03T13:45:00]i000: Setting string variable 'WixBundleName' to value 'SqlServerBootstrapper'
[0C80:2190][2020-08-03T13:45:00]i000: Setting string variable 'WixBundleManufacturer' to value 'Company'
[0C80:2060][2020-08-03T13:45:02]i000: Setting numeric variable 'WixStdBALanguageId' to value 1033
[0C80:2060][2020-08-03T13:45:02]i000: Setting version variable 'WixBundleFileVersion' to value '1.0.0.0'
[0C80:2190][2020-08-03T13:45:05]i100: Detect begin, 2 packages
[0C80:2190][2020-08-03T13:45:05]i000: Setting string variable 'NETFRAMEWORK40' to value '1'
[0C80:2190][2020-08-03T13:45:05]i000: Setting numeric variable 'SqlInstanceFoundx64' to value 1
[0C80:2190][2020-08-03T13:45:05]i000: Registry key not found. Key = 'SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL'
[0C80:2190][2020-08-03T13:45:05]i000: Setting numeric variable 'SqlInstanceFoundx86' to value 0
[0C80:2190][2020-08-03T13:45:05]i052: Condition 'NETFRAMEWORK40' evaluates to true.
[0C80:2190][2020-08-03T13:45:05]i052: Condition 'SqlInstanceFoundx64 OR SqlInstanceFoundx86' evaluates to true.
[0C80:2190][2020-08-03T13:45:05]i101: Detected package: NetFx40Redist, state: Present, cached: None
[0C80:2190][2020-08-03T13:45:05]i101: Detected package: SQLEXPR_x64_ENU.exe, state: Present, cached: None
[0C80:2190][2020-08-03T13:45:05]i199: Detect complete, result: 0x0
[0C80:2060][2020-08-03T13:45:14]i000: Setting numeric variable 'EulaAcceptCheckbox' to value 1
[0C80:2190][2020-08-03T13:45:14]i200: Plan begin, 2 packages, action: Install
[0C80:2190][2020-08-03T13:45:14]w321: Skipping dependency registration on package with no dependency providers: NetFx40Redist
[0C80:2190][2020-08-03T13:45:14]w321: Skipping dependency registration on package with no dependency providers: SQLEXPR_x64_ENU.exe
[0C80:2190][2020-08-03T13:45:14]i201: Planned package: NetFx40Redist, state: Present, default requested: Present, ba requested: Present, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0C80:2190][2020-08-03T13:45:14]i201: Planned package: SQLEXPR_x64_ENU.exe, state: Present, default requested: Present, ba requested: Present, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0C80:2190][2020-08-03T13:45:14]i299: Plan complete, result: 0x0
[0C80:2190][2020-08-03T13:45:14]i300: Apply begin
[0C80:2190][2020-08-03T13:45:14]i010: Launching elevated engine process.
[0C80:2190][2020-08-03T13:45:20]i011: Launched elevated engine process.
[0C80:2190][2020-08-03T13:45:21]i012: Connected to elevated engine.
[21CC:193C][2020-08-03T13:45:21]i358: Pausing automatic updates.
[21CC:193C][2020-08-03T13:45:21]i359: Paused automatic updates.
[21CC:193C][2020-08-03T13:45:21]i360: Creating a system restore point.
[21CC:193C][2020-08-03T13:45:21]i362: System restore disabled, system restore point not created.
[21CC:193C][2020-08-03T13:45:21]i370: Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9cb6c70d-a76f-4d3e-a888-5fa88f0fc7ac}, options: 0x7, disable resume: No
[21CC:193C][2020-08-03T13:45:26]i000: Caching bundle from: 'C:\Users\USER~1.DOMAIN-\AppData\Local\Temp\{A0E2EEB3-EB06-4833-8048-1AFF9AFF2A89}\.be\SqlServerBootstrapper.exe' to: 'C:\ProgramData\Package Cache\{9cb6c70d-a76f-4d3e-a888-5fa88f0fc7ac}\SqlServerBootstrapper.exe'
[21CC:193C][2020-08-03T13:45:26]i320: Registering bundle dependency provider: {9cb6c70d-a76f-4d3e-a888-5fa88f0fc7ac}, version: 1.0.0.0
[21CC:193C][2020-08-03T13:45:26]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9cb6c70d-a76f-4d3e-a888-5fa88f0fc7ac}, resume: Active, restart initiated: No, disable resume: No
[21CC:193C][2020-08-03T13:45:26]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9cb6c70d-a76f-4d3e-a888-5fa88f0fc7ac}, resume: ARP, restart: None, disable resume: No
[21CC:193C][2020-08-03T13:45:26]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9cb6c70d-a76f-4d3e-a888-5fa88f0fc7ac}, resume: ARP, restart initiated: No, disable resume: No
[0C80:2190][2020-08-03T13:45:26]i399: Apply complete, result: 0x0, restart: None, ba requested restart:  No
...