WiX - attempt to determine installation sequences

I am installing a large application, and part of it is a custom tool called "DbUpdateManager" for mass execution of SQL scripts with our target database.

Currently, installing WiX 2.x works, but it has one drawback: during the installation, I also install a couple of Windows services that you can start right away. However, they will not work if DbUpdateManager is not already running.

So, I am trying to do the following:

  • Install DbUpdateManager and my services from my MSI
  • Run DbUpdateManager before starting any of the services

My current WiX source looks something like this:

<Directory Id='INSTALLDIR' Name='DbUpdMgr' LongName='DbUpdateManager' >
  <!-- DbUpdateManager component with the necessary files -->
  <Component Id='DbUpdateManagerComponent' Guid='...' DiskId='1'>
     <File Id='DbUpdateManagerFile' LongName='DbUpdateManager.Wizard.exe' 
           Name='DbUmWz.exe' src='DbUpdateManager.Wizard.exe'  KeyPath='no' />
  </Component>

  <!-- Component to install one of my Windows services -->
  <Component Id='InstallServiceComponent' Guid='...' DiskId='1'>
     <File Id='InstallServiceFile' LongName='MyService.exe' 
           Name='MyServic.exe' src='MyService.exe' KeyPath='yes'/>
     <ServiceInstall Id='InstallMyService' Name='MyService' 
                     Description='My Service' ErrorControl='normal' 
                     Start='auto' Type='ownProcess' Vital='yes' />
     <ServiceControl Id='UninstallMyService' Name='MyService' 
                     Remove='uninstall' Wait='yes' />
  </Component>

  <!-- Feature for the DbUpdateManager referencing the above component -->    
  <Feature Id='DbUpdateManager' ConfigurableDirectory='INSTALLDIR' 
           AllowAdvertise='no' Description='DbUpdateManager' Level='1' 
           Title='Database Update Manager'>
     <ComponentRef Id='DbUpdateManagerComponent'/>
  </Feature>

  <!-- Custom action for running DbUpdateManager -->    
  <CustomAction Id='RunDbUpdateManagerAction' FileKey='DbUpdateManagerFile' 
                ExeCommand='' Return='asyncWait' />

  <!-- Calling the custom action in the install sequence -->    
  <InstallExecuteSequence>
      <RemoveExistingProducts After='InstallInitialize' />
      <Custom Action='RunDbUpdateManagerAction' 
              After='InstallFinalize'>&amp;DbUpdateManager=3</Custom>

WIX, , , , DbUpdateManager ( "After = InstallFinalize" ), , , ( , DbUpdateManager).

MSI "StartServices", , :

   <InstallExecuteSequence>
          <Custom Action='RunDbUpdateManagerAction' 
                  Before='StartServices'>&amp;DbUpdateManager=3</Custom>

, - DbUpdateManager NEVER ....

, ? MSI/WiX , ....

!

EDIT: "RunDbUpdateManagerAction" InstallExecuteSequence MSI - InstallServices StartServices - ... DbUpdateManager ( Winforms) : - (

EDIT 2: , , - , :-( , " 1631", - " MSI " - wtf???

MSI (s) (2C: D8) [20: 53: 36: 383]: : RunDbUpdateManagerAction 20:53:36: RunDbUpdateManagerAction. 20:53:36: RunDbUpdateManagerAction. MSI (s) (2C: D8) [20: 53: 36: 383]: : StartServices 20:53:36: StartServices. 20:53:36: StartServices. 20:53:36: RunDbUpdateManagerAction. 1631.

+5
4

: msiexec/i [msiname]/l * v [_]

EDIT: , ,

EDIT2: page 1631

+4

, , - , , , WiX . MSI ...

, "" ( ), , , "After = InstallFiles". <Custom> "NOT Installed", , , .

, Db , , ( ).

RTM WiX 3.0 ( )!

- , - .

+10

, CustomAction "DbUpdateManagerFile". , CustomAction InstallFiles. , InstallExecuteSequence. -, (aka: "install script" ) "" ( "" "script " ). -, "" .

CustomAction "" ( ), , . InstallFiles script CustomAction, .

, CustomAction "", , .

. , . , , .

PS: , , .

+6

.msi Orca InstallExecuteSequence, , . , , .

+4

All Articles