There's a set of immediate custom actions in http://msiext.codeplex.com that you can schedule at will. The one you want is ODBCExecute.
There's also a whole stack of Wix extensions for ODBC generically and SQL server specifically if you decide that what's included in Wix doesn't do it for you. cheers dB. dB. @ dblock.org Moscow|Geneva|Seattle|New York -----Original Message----- From: Nathan Zaugg [mailto:nza...@gmail.com] Sent: Wednesday, June 02, 2010 7:07 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Detach Databases on Uninstall I think I now have some insight. The reason I can't connect is because WIX detected that SQL Server was using a file that was included in the installation and stopped SQL Server during the uninstall. Any idea how I coax it to running those scripts toward the beginning of the uninstall? Action 17:02:12: ExecuteSqlStrings. Executing SQL Strings MSI (s) (F8:F4) [17:02:12:349]: Executing op: CustomActionSchedule(Action=ExecuteSqlStrings,ActionType=25601,Source=BinaryData,Target=**********,CustomActionData=**********) MSI (s) (F8:F4) [17:02:12:358]: Creating MSIHANDLE (44) of type 790536 for thread 5108 MSI (s) (F8:6C) [17:02:12:359]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIC91F.tmp, Entrypoint: ExecuteSqlStrings MSI (s) (F8!80) [17:02:29:356]: Creating MSIHANDLE (45) of type 790531 for thread 1152 ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to database: master MSI (s) (F8!80) [17:02:29:356]: Closing MSIHANDLE (45) of type 790531 for thread 1152 MSI (s) (F8!80) [17:02:29:357]: Creating MSIHANDLE (46) of type 790531 for thread 1152 ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to database: master MSI (s) (F8!80) [17:02:29:357]: Closing MSIHANDLE (46) of type 790531 for thread 1152 MSI (s) (F8!80) [17:02:29:357]: Creating MSIHANDLE (47) of type 790531 for thread 1152 ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to database: master MSI (s) (F8!80) [17:02:29:358]: Closing MSIHANDLE (47) of type 790531 for thread 1152 MSI (s) (F8!80) [17:02:29:358]: Creating MSIHANDLE (48) of type 790531 for thread 1152 ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to database: master MSI (s) (F8!80) [17:02:29:358]: Closing MSIHANDLE (48) of type 790531 for thread 1152 MSI (s) (F8!80) [17:02:29:358]: Creating MSIHANDLE (49) of type 790531 for thread 1152 ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to database: master MSI (s) (F8!80) [17:02:29:359]: Closing MSIHANDLE (49) of type 790531 for thread 1152 MSI (s) (F8!80) [17:02:29:359]: Creating MSIHANDLE (50) of type 790531 for thread 1152 ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to database: master MSI (s) (F8!80) [17:02:29:359]: Closing MSIHANDLE (50) of type 790531 for thread 1152 MSI (s) (F8:6C) [17:02:29:363]: Closing MSIHANDLE (44) of type 790536 for thread 5108 On Tue, Jun 1, 2010 at 4:55 PM, Michael Osmond <mosm...@baytech.com.au> wrote: > Hi > > Another option to trace this is to use SQL Profiler - it should show the > calls being made and any errors occurring. > > By setting ContinueOnError="yes" any errors will be swallowed (they may be in > the log). If you are doing this only to make the uninstall robust against > the database not existing, perhaps you should wrap the detach process in a > test of the database existing instead. > > Michael > > > -----Original Message----- > From: Pally Sandher [mailto:pally.sand...@iesve.com] > Sent: Wednesday, 2 June 2010 4:12 AM > To: General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] Detach Databases on Uninstall > > Try using "msiexec /i <msiname> /l*vx <logname>" to get verbose logs. > > I'm not sure on what info the WiX Standard Custom Actions like SqlExtension > put into the logs but those options should get everything & might help point > out where it's failing. For some reason I've got a feeling there is some > Property or variable you may need to set to get the Standard Custom Actions > to put more stuff into the logs, not 100% sure on that though & I can't find > any reference to it anywhere so I might be mixing it up with something else. > Hopefully if it does exist someone else will remember what I'm rambling about > & clarify. > > Palbinder Sandher > Software Deployment & IT Administrator > T: +44 (0) 141 945 8500 > F: +44 (0) 141 945 8501 > > http://www.iesve.com > **Design, Simulate + Innovate with the <Virtual Environment>** > Integrated Environmental Solutions Limited. Registered in Scotland No. > SC151456 > Registered Office - Helix Building, West Of Scotland Science Park, Glasgow > G20 0SP > Email Disclaimer > > -----Original Message----- > From: Nathan Zaugg [mailto:nza...@gmail.com] > Sent: 28 May 2010 19:58 > To: wix-users@lists.sourceforge.net > Subject: [WiX-users] Detach Databases on Uninstall > > I am trying to detach databases on uninstall. I know the commands I have > work but for some reason this action fails. We're using integrated > authentication and I wonder if that might be part of it. I have also tried > running osql/sqlcmd as an install action. It didn't work either and it > didn't give me anything interesting in the log. > > Any suggestions? If I run these commands from a command line they work fine. > > Thanks! > Nate > > <sql:SqlDatabase Id="Master" Server="." Instance="SQLEXPRESS" > Database="master" /> > > <sql:SqlString Id="OfflineQCEW" ContinueOnError="yes" > ExecuteOnUninstall="yes" SqlDb="Master" SQL="ALTER DATABASE QCEW.Deploy SET > OFFLINE WITH ROLLBACK IMMEDIATE" /> <sql:SqlString Id="DetachQCEW" > ContinueOnError="yes" > ExecuteOnUninstall="yes" SqlDb="Master" SQL="EXEC master.dbo.sp_detach_db > @dbname = N'[iQFolder]\QCEW.Deploy.MDF'"/> > > <!--Detach QCEWCommon--> > <sql:SqlString Id="OfflineQCEWCommon" ContinueOnError="yes" > ExecuteOnUninstall="yes" SqlDb="Master" SQL="ALTER DATABASE QCEWCommon SET > OFFLINE WITH ROLLBACK IMMEDIATE" /> <sql:SqlString Id="DetachQCEWCommon" > ContinueOnError="yes" > ExecuteOnUninstall="yes" SqlDb="Master" SQL="EXEC master.dbo.sp_detach_db > @dbname = N'[iQFolder]\QCEWCommon.MDF'"/> > > <!--Detach QCEWSecurity--> > <sql:SqlString Id="OfflineQCEWSecurity" ContinueOnError="yes" > ExecuteOnUninstall="yes" SqlDb="Master" SQL="ALTER DATABASE QCEWSecurity SET > OFFLINE WITH ROLLBACK IMMEDIATE" /> <sql:SqlString Id="DetachQCEWSecurity" > ContinueOnError="yes" > ExecuteOnUninstall="yes" SqlDb="Master" SQL="EXEC master.dbo.sp_detach_db > @dbname = N'[iQFolder]\QCEWSECURITY.MDF'"/> > > > Action 19:16:00: ExecuteSqlStrings. Executing SQL Strings > ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to > database: master > ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to > database: master > ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to > database: master > ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to > database: master > ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to > database: master > ExecuteSqlStrings: Error 0x80004005: continuing after failure to connect to > database: master > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > ------------------------------------------------------------------------------ > > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users