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' >
<Component Id='DbUpdateManagerComponent' Guid='...' DiskId='1'>
<File Id='DbUpdateManagerFile' LongName='DbUpdateManager.Wizard.exe'
Name='DbUmWz.exe' src='DbUpdateManager.Wizard.exe' KeyPath='no' />
</Component>
<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 Id='DbUpdateManager' ConfigurableDirectory='INSTALLDIR'
AllowAdvertise='no' Description='DbUpdateManager' Level='1'
Title='Database Update Manager'>
<ComponentRef Id='DbUpdateManagerComponent'/>
</Feature>
<CustomAction Id='RunDbUpdateManagerAction' FileKey='DbUpdateManagerFile'
ExeCommand='' Return='asyncWait' />
<InstallExecuteSequence>
<RemoveExistingProducts After='InstallInitialize' />
<Custom Action='RunDbUpdateManagerAction'
After='InstallFinalize'>&DbUpdateManager=3</Custom>
WIX, , , , DbUpdateManager ( "After = InstallFinalize" ), , , ( , DbUpdateManager).
MSI "StartServices", , :
<InstallExecuteSequence>
<Custom Action='RunDbUpdateManagerAction'
Before='StartServices'>&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.