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

AppSearch and Directory paths


3 replies to this topic

TonyLowrey

TonyLowrey
  • Members
  • 15 posts

Posted 02 December 2005 - 13:07

I have searched for an explanation of when default property values are used and overwritten with no success so here goes...

I am writing a merge module which installs components in a "My Shared" subdirectory of "Program Files\Common files\". The path is saved in a registry key under HKLM\SOFTWARE\CompanyName\Shared\ value:Base Folder which may or may not exist. This default location may have been changed by a previous install so it is saved in the registry.

I want the merge module to default the installation directory to [CommonFilesFolder]My Shared.

If the AppSearch finds the registry setting I want to use it instead of the default setting above. This sounds like a simple thing to ask but I cannot seem to get it to work.

Q1) How do I set a directory property which is defaulted but which can be overwritten by an AppSearch?
Q2) If the same property is used in both the Property table and the Directory table which default value is used when the directory path is applied to a component install location?
Q3) How do I make a property value dependent on another property value?

Any help welcome! dry.gif



KathyMorey

KathyMorey
  • Full Members
  • 111 posts

Posted 02 December 2005 - 15:05

I can't specifically answer your questions, but I can tell you what I have had success with.

I use AppSearch to look for a path in a registry entry and store it in a public variable. Then, after CostFinalize I use a SetDirectory custom action to set my directory to that property. My custom action is conditioned on the existence of the public property, so that it won't occur if that property is not set (was not found in the registry).

Thus the project uses the default if the registry entry is not present, but used the value in the registry entry if it is present.
Kathy Morey
Synergy Software Engineer
ProfitStars, a Jack Henry Company
kmorey@profitstars.com

TonyLowrey

TonyLowrey
  • Members
  • 15 posts

Posted 02 December 2005 - 15:13

I see how this will work and it's very simple, thanks.

However, I was hoping to avoid the use of a Custom Action as this is a merge module and there is less control over what else is going on in the enclosing MSI file although I guess a property within the merge module will not clash with anything outside and as long as the CA is after CostFinalise all the directories are frozen.

I would also like to understand more what is going on under the covers specifically how the directory properties are resolved with the same-named Public Properties and properties set in AppSearch. The documentation is not clear.

Edited by TonyLowrey, 02 December 2005 - 15:16.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 December 2005 - 19:23

Having a property both in Property table and Directory doesn't make sense. I don't know if it is allowed and which of the two settings will win, but you should do only one of them.
I believe that AppSearch would overwrite the default that was set in Directory table, so you might be able to do it without a custom action.
Properties won't clash because properties in merge modules get appended with the module guid.