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

Favor Source and Registry


5 replies to this topic

comecme

comecme
  • Members
  • 30 posts

Posted 03 November 2003 - 00:21

I'm trying to find a way to have registry entries in a component. The component will run from Source (it's actually set to Optional). The entry contains a DirID of one of the files in my setup, for instance [INSTALLDIR]SubDir.

Now, when I install this MSI and select Run From Network for the features, the registry-entry will stil point to to Local directory that INSTALLDIR originally points to.

I can work around this by specifying the INSTALLDIR from the command line, and letting it point to the network location where the files reside, but that isn't a solution I like.

Am I missing some easier way to do this? I would expect a component that is set to Favor Source to use the Source directories for everything it does, so including the registry modifications.
Dick Nagtegaal

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 03 November 2003 - 12:23

Instead of [INSTALLDIR] use [$ComponentName]. For more information look up the "Formatted" data type in MSI help.

comecme

comecme
  • Members
  • 30 posts

Posted 03 November 2003 - 15:15

I guess I'm missing something, but I can't get it to work.

I've created a very simple MSI, containing only one Feature, one Component, One File and One Registry Entry.

The Feature is named Feature1 and set to Favor Source. It contains the component Component1 which is set to Install into [INSTALLDIR] and has its Remote Installation option set to Optional. The component also contains one Registry Entry. In HKLM\SOFTWARE\[Manufacturer]\[ProductName] I create a String Value named RootDir with the value [$Component1].

After installing the MSI my RootDir contains the value [$Component1].

You said to use [$ComponentName], but the Platform SDK talks about [$ComponentKey]. I'm assuming you mean the same thing, which is the actual name of the component.
The SDK also states
QUOTE
In the Value column of the Registry Table, this substring may refer to the action state or the requested action state of the component. In all other cases, this substring refers to the action state of component.

I must admit that I don't undestand what is meant by that. I'd say that the action state is something else than the directory of the component. But the SDK continues with
QUOTE
For example, If the component is run from the source, the value is the source directory of the file. If the component is run locally, the value is the target directory after installation.


I've also tried using [#filekey] (in my case [#File1.TXT]), and that does work.

So I'm stuck here. What am I doing wrong? I sure hope you can help.
Dick Nagtegaal

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 03 November 2003 - 15:23

The problem is most likely that InstallShield thinks you want to put the literal string [$Component1] in the registry, and therefore escapes the [ and ]. Go to Direct Editor and in Registry table you'll find:
[\[]Component1[\]]
Change this to [Component1] and it should work.

comecme

comecme
  • Members
  • 30 posts

Posted 03 November 2003 - 15:35

Wow! That's a quick reply!

You are right biggrin.gif . InstallShield tries to "help" blink.gif by thinking it knows better than me what I want.

That it changes my [Component1] into [\[]$Component1[\]] is one thing, but it displays both values in the registry view as [Component1]. So the only way to find out what is the actual value is to look directly in the Registry table.

So I guess this message should now be in the InstallShield Developer forum? wink.gif

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 03 November 2003 - 16:37

QUOTE (comecme @ 2003-11-03 16:35)
So I guess this message should now be in the InstallShield Developer forum? wink.gif

I believe that other authoring tools work in a similar way.