Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Setting registry data if property is set


4 replies to this topic

zims@bjallas.com

zims@bjallas.com
  • Full Members
  • 5 posts

Posted 06 November 2007 - 16:28

I have a “Basic MSI Project” that has one property called SQLSERVER. I am able to set this property from the command line when I run Setup.exe. I use this property to write a registry value. So far everything works fine.

Now I have 2 scenarios.

1.
My end user runs Setup.exe (without setting the SQLSERVER property) to do a Minor Upgrade, Repair or to change the installed Features. Since the SQLSERVER property was not set I would like the value already in the registry to be unmodified.

2.
My end user runs Setup.exe (and sets the SQLSERVER property thru the command line) ) to do a Minor Upgrade, Repair or to change the installed Features. Since the SQLSERVER property was set I want to update the value in the registry.

Is it possible to make both scenarios to work, and if it is how?

Thomas

Edited by zims@bjallas.com, 06 November 2007 - 16:38.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 06 November 2007 - 17:22

It is possible. Use System Search to read the existing value from registry to pre-populate the property.

zims@bjallas.com

zims@bjallas.com
  • Full Members
  • 5 posts

Posted 06 November 2007 - 22:34

By using System Search as you suggested I am able to make Scenario 1 to work. But what if I wan't to make both 1 and 2 work at the same time. If the user specifies the property from the command line I want to use that value. if the user don't specifies a value i want to use the value in the registry


When i used System Search to get the value from the registry it sort of Overwrites the value from the command line. Is it possible to only do the System Seach if no value was specified from the command line. Can i change the order of all Sequence?


/Thomas

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 November 2007 - 10:04

For your System Search, use a different property name. After the AppSearch action (in both sequences) add a custom action type 51 "set a property" that will overwrite the property only if it was not set on the command line. E.g.:

Source (property to set): SQLSERVER
Target (value): [SQLSERVER_SYSTEMSEARCH]
Condition: Not SQLSERVER

In property manager, remove SQLSERVER and set a default value for SQLSERVER_SYSTEMSEARCH


zims@bjallas.com

zims@bjallas.com
  • Full Members
  • 5 posts

Posted 07 November 2007 - 17:23

Thanks for the good solution. This did exactly what i wanted to do.

/Thomas