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

Query Component Location - Administrative Install


2 replies to this topic

andyguest13

andyguest13
  • Full Members
  • 21 posts

Posted 10 February 2009 - 14:54

Hi.

I have authored a basic MSI package (using IS Premier 2008 as it happens) such that most of the components remain on the server via an administrative install followed by installs on network client machines, and all works as expected. For example my executables remain on the server, and the client's Startmenu shortcut does indeed launch the mainprogram.exe off the server.

At the end of the client install though, i now need to write an INI file with some component paths in. But i cannot find what Property, or what information, to query to pass into the INI. Using above mainprogram.exe as an example, if i put

myIniPathValue = [INSTALLDIR]mainprogram.exe

that yields the correct string for regular installs, but not for client ones. How can i determine whether a component is run from source and get it's path; can i get the Startmenu shortcut path somehow? I looked in a .log after a client install but nothing seemed appropriate. I guess CA's might be the answer if i hunt in [SOURCEDIR] but i would rather do it more neatly in the MSI itself.

*it would also be great if i could determine the very fact that a client install was performed from the mini-MSI that msiexec created in my server folder and record that fact into my Ini too! Again i guess i *could* do this with a CA that looks at SOURCEDIR and sees if there are any files or folders in there apart from the MSI but that seems kludgy...

Thank you
Andy

Edited by andyguest13, 10 February 2009 - 17:41.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 11 February 2009 - 15:14

Take a look at the documentation for "Formatted", it looks like you could use [#filekey] (where filekey is the value in the first column of the File table associated with mainprogram.exe

Quote from the help topic:
If a substring of the form [#filekey] is found, it is replaced by the full path of the file, with the value filekey used as a key into the File table. ... The value of [#filekey] depends upon the installation state of the component to which the file belongs. If the component is run from the source, the value is the path to the source location of the file. If the component is run locally, the value is the path to the target location of the file after installation.

For your second question I think the answer is the IsAdminPackage property.

andyguest13

andyguest13
  • Full Members
  • 21 posts

Posted 12 February 2009 - 12:04

Thanks Stefan, that has solved my problems! I would never have stumbled across the Formatted thing myself i don't think. One thing to mention for others is that the Filekey (for me anyway) is always long filename equivalent of my file, but all in lower case - which matters. I have not investigated what happens if i have two files with exactly the same name but in different folders in my package.

thanks again
andy

Edited by andyguest13, 12 February 2009 - 12:05.