Great! Thank you verrrrry
mucho!
The [D4WSQLSERVER] property was indeed unknown during
uninstall; after reading it from the registry that part was solved (eg. the
error that is ;) )
And the SqlDb part did the other trick .. I also dropped some more unneccesary stuff to make it more general and easier to read. So the code now looks like: (so
anyone who needs it can use the idea)
<!-- codesnippet under Product
-->
<?define
guidDatabaseComponent = "YOUR-GUID-HERE-ETC..." ?>
<?define strMyXPProcDll = "C:\Program Files\MyDir\xp_MyProc.dll" ?> <Property Id="MYSQLSERVER"> <!-- Assume some other CA can fill it up when it's empty during install :) --> <RegistrySearch Id="SearchForSQLServerName" Root="HKLM" Key="Software\[Manufacturer]\[ProductName]\Applications\[UpgradeCode]" Name="MySQLServerOnInstall" Type="raw" /> </Property> <SqlDatabase Id="MyDatabase" Database="master" Server="[MYSQLSERVER]"
/>
<DirectoryRef Id="TARGETDIR">
<Component Id="DatabaseComponent" Guid="$(var.guidDatabaseComponent)"> <Condition>MYSQLSERVER <> ""</Condition> <!-- Uninstall / rollback install -->
<SqlString Id="UnRegister_xp_My_Func1" Sequence="1" SqlDb="MyDatabase" ContinueOnError="yes" ExecuteOnInstall="no" ExecuteOnReinstall="yes" ExecuteOnUninstall="yes" RollbackOnInstall="yes" SQL="if exists (select * from sysobjects where id = object_id(N'dbo.xp_My_Func') and OBJECTPROPERTY(id, N'IsExtendedProc') = 1) EXEC sp_dropextendedproc 'xp_My_Func'" /> <!-- Unregister before delete/replace xp_MyProc.dll
-->
<SqlString Id="Free_xp_MyProc" Sequence="2" SqlDb="MyDatabase" ContinueOnError="yes" ExecuteOnInstall="no" ExecuteOnReinstall="yes" ExecuteOnUninstall="yes" RollbackOnInstall="yes" SQL="DBCC xp_MyProc(FREE)" /> <!-- Register on install / reinstall -->
<SqlString Id="Register_xp_My_Func" Sequence="3" SqlDb="MyDatabase" ExecuteOnInstall="yes" ExecuteOnReinstall="yes" RollbackOnUninstall="yes" SQL="if not exists (select * from sysobjects where id = object_id(N'dbo.xp_My_Func') and OBJECTPROPERTY(id, N'IsExtendedProc') = 1) EXEC sp_addextendedproc 'xp_My_Func', '$(var.strMyXPProcDll)' GRANT EXECUTE ON xp_My_Func TO public" /> </Component> </DirectoryRef> <!-- /codesnippet -->
Maybe something like this can be added to the tutorial? Albert
Van: Michael Osmond [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 27 juni 2006 0:09 Aan: Albert van Peppen; wix-users@lists.sourceforge.net Onderwerp: RE: [WiX-users] SQL Extended stored procedures Hello,
When doing the uninstall how is the property [D4WSQLSERVER] resolved, it
could be that this has no value set and hence the installer can't locate the
database server when uninstalling.
Also its trying to uninstall the master database because its part of a
component. Try putting the <sqldatabase> element under
<product> not in the component and then use the SqlDb="xxx" attribute to
link to the database. That way the installer is just referencing master
not trying to install it.
Michael
|
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users