So I persisted my property value to the registry and use a registry search
in the property to try to retrieve the value.
My issue is 2 fold. One, the property values aren't being populated from the
registry properly on uninstall. It might be that the keys are deleted
(uninstalled) before they get a chance to be read or it might be they're
just being ignored.
Second, I'm not sure that I have my custom action set up correctly to get
run at uninstall. I need it to get the server name in the expected sql
format (either {dbname}\{instancename} or just {dbname}).
The relevant values are below. Any help would be appreciated, I really can't
figure out what to do at this point.
Thanks,
Peter
It looks something like this:
<RegistryKey
Id="CreateKey"
Root="HKLM"
Action="create"
Key="$(var.RegKey)">
<RegistryValue
Id="SetDatabaseServer"
Action="write"
Type="string"
Name="DatabaseServer"
Value="[TMEDATABASESERVER]"
/>
<RegistryValue
Id="SetDatabaseInstance"
Action="write"
Type="string"
Name="DatabaseInstance"
Value="[TMEDATABASEINSTANCE]"
/>
<RegistryValue
Id="SetDatabaseName"
Action="write"
Type="string"
Name="DatabaseName"
Value="[TMEDATABASENAME]"
/>
</RegistryKey>
And
<Property Id="TMEDATABASESERVER" Value="(local)">
<RegistrySearch
Id="RegistrySearchTMEDatabaseServer"
Type="raw"
Root="HKLM"
Key="$(var.RegKey)"
Name="DatabaseServer"
/>
</Property>
<Property Id="TMEDATABASEINSTANCE" Value="SQLEXPRESS">
<RegistrySearch
Id="RegistrySearchTMEDatabaseInstance"
Type="raw"
Root="HKLM"
Key="$(var.RegKey)"
Name="DatabaseInstance"
/>
</Property>
<Property Id="TmeDatabase" Value=".\SQL" />
<Property Id="TMEDATABASENAME" Value="TME">
<RegistrySearch
Id="RegistrySearchTMEDatabaseName"
Type="raw"
Root="HKLM"
Key="$(var.RegKey)"
Name="DatabaseName"
/>
</Property>
Because I support both named and unnamed instances I have a custom action to
copy the property from TMEDATABASESERVER and TMEDATABASEINSTANCE to
TmeDatabase correctly depending on whether TMEDATABASEINSTANCE is specified.
That looks like:
<CustomAction Id="CA_SetDatabaseNoInstance" Return="check"
Property="TmeDatabase" Value="[TMEDATABASESERVER]" />
<CustomAction Id="CA_SetDatabaseInstance" Return="check"
Property="TmeDatabase" Value="[TMEDATABASESERVER]\[TMEDATABASEINSTANCE]" />
<InstallExecuteSequence>
<Custom Action="CA_SetDatabaseInstance"
Before="InstallValidate"><![CDATA[TMEDATABASEINSTANCE]]></Custom>
<Custom Action="CA_SetDatabaseNoInstance"
Before="InstallValidate"><![CDATA[NOT TMEDATABASEINSTANCE]]></Custom>
</InstallExecuteSequence>
-----Original Message-----
From: Neil Sleightholm [mailto:[email protected]]
Sent: Saturday, January 24, 2009 2:34 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Install variable not kept around for uninstall?
If you need properties at uninstall time you need to persist them
somewhere and read them on uninstall, the registry is a common location
for these.
Neil
-----Original Message-----
From: Peter Oehlert [mailto:[email protected]]
Sent: 24 January 2009 19:58
To: 'General discussion for Windows Installer XML toolset.'
Subject: [WiX-users] Install variable not kept around for uninstall?
So my scenario is that I query the user at install time what the
database
server, instance, and name should be. I then use these variables in a
<sql:SqlDatabase /> element to install a database.
This works great, except that if I change any of the default values at
uninstall it seems to go back to using the default values. I basically
have
a UI Dialog with a Edit control that is tied to a property for each of
these
values. I then dereference the property in the SqlDatabase element. How
do I
persist this value so that when I uninstall it tries to drop the correct
database rather than the default one?
Thanks in advance,
Peter Oehlert
------------------------------------------------------------------------
------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
----------------------------------------------------------------------------
--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users