File key as a property?
Just wondering if you could use the file key is a property in the same way you can use a directory as a property?
I.e. if you run a simple custom action script:
a=Session.Property("[INSTALLDIR]")
msgbox(a)
It will print the path to INSTALLDIR.
I was hoping I could do the same thing with a file key from the File table. Doesn't seem to work though. Anyone have any information or knowledge about this? If I can pull the full path to the file I don't have to hardcore the file path or the filename in my script. (I get that I can use the directory and then hardcode the file name but kind of wished I could be even smoother.)
3 Comments
[ + ] Show comments
Answers (0)
Please log in to answer
Be the first to answer this question
The file table does not generate any properties that can be used, but I'm not clear on what you wish to achieve. - EdT 9 years ago
strFile = Session.Property("INSTALLDIR") & "Filename.exe"
Now if you change filename.exe then you'll have to update the custom action script to reflect this change. However if you could simply use the file key (first column in File table) the same way you retrieve the INSTALLDIR then you'd be completely future-proof.
I guess it's simply not supported, at least not in any easy way, but I figured it should be :) - dreyer 9 years ago
For the record, you can even dynamically change the tables during install or uninstall if the need arises. - EdT 9 years ago
In regards to putting the action after InstallFinalize I understand your point. I've simply added a "On Error Resume Next" in the VBScript custom action that runs however, so it can never fail and cause the installer to become "stuck". - dreyer 9 years ago