Thanks. That did the trick here is the code I used: <Property Id="WIXUI_DATABASESERVER" > <RegistrySearch Id="SbDatabaseName" Type="raw" Root="HKLM" Name="DatabaseName" Key="Software\CompanyName\Product\Install"></RegistrySearch> </Property>
<Component Id="DatabaseNameReg" Guid="Guid"> <RegistryKey Root="HKLM" Key="Software\CompanyName\Product\Install" Action="createAndRemoveOnUninstall"> <RegistryValue Name="DatabaseName" Value="[WIXUI_DATABASESERVER]" Type="string" KeyPath="yes"></RegistryValue> </RegistryKey> </Component> Under features: <ComponentRef Id="DatabaseNameReg"/> To check if the script should run on an uninstall I added "AND (NOT WIXUI_DATABASESERVER="")" to the custom action: <Custom Action="sqlcmd.cmd" Before="RemoveFiles">CONFIGCHOICE=2 AND (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") AND (NOT WIXUI_DATABASESERVER="")</Custom> -----Original Message----- From: Wendell Joost [mailto:wende...@gmail.com] Sent: Thursday, March 18, 2010 6:03 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Storing a Property Write the property to the registry hklm\software\[company]\[productname]\[version]\DatabaseName=Value Read the property during uninstall. If property isn't found, don't execute the uninstll script. Wendell On Thu, Mar 18, 2010 at 2:46 PM, David J. D'Amico <dav...@avi.com> wrote: > I'm running a database script as part of my installation. There is a > text box that the user can type the name of a SQL Server. During the > install process a script is run on the server specified by the user. On > uninstall I want to run another script that will the undo all the > changes to the database made during the install process. The text box is > mapped to a property called DATABASENAME. What is the best way to store > a property so I can retrieve it when processing an uninstall? > > > > Thanks, > > Dave > > > > ------------------------------------------------------------------------ ------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > -- "Some people come visit Europe and are really let down when they find out it's not like a credit-card commercial; others really get into meeting all the quirky people and careening along narrow mountain roads in rickety cabs driven by suicidal, gap-toothed Carpathians. I guess it's pretty obvious which one you are..." - Justin Crevier, May '01 ------------------------------------------------------------------------ ------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users