This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- method to get MSI filename from within same MSI
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Jan 23, 2012
05:23 PM
method to get MSI filename from within same MSI
I am looking into the possibility of using a method where after building the MSI the filename is changed to match a customer Id. Then I'd like to be able then take that filename and use it during the install process but I need to be able to get the MSI filename when that same MSI is running. I know I can pass params and such but for the circumstance I'm trying to cover that is not possible.
I've searched but could not find a way to do this other than a FindAllFiles using the SupportDir param as the starting point. I don't like this method though because if a user happens to save the file at the Root of their drive this will search their entire drive.
I also considered FindFile but the problem here is that the user may have more than one MSI file in the location and FindFile only gives you the first one found, alphabetically.
So besides searching is there some way to get the MSI filename from within the running MSI? Remember that the name is changed post build time.
Thanks,
J
I've searched but could not find a way to do this other than a FindAllFiles using the SupportDir param as the starting point. I don't like this method though because if a user happens to save the file at the Root of their drive this will search their entire drive.
I also considered FindFile but the problem here is that the user may have more than one MSI file in the location and FindFile only gives you the first one found, alphabetically.
So besides searching is there some way to get the MSI filename from within the running MSI? Remember that the name is changed post build time.
Thanks,
J
(2) Replies
‎Jan 23, 2012
06:45 PM
From memory I don't know if there's a simple way. The OriginalDatabase property has the full path or URL of a running MSI, so maybe a custom action that extracts the file name from the end of the value would do it? I haven't tried it, so no promises.
KB article Q105766 mentions OriginalDatabase, and also points out that the value isn't what you might want during uninstallation, but it might be worth looking into.
KB article Q105766 mentions OriginalDatabase, and also points out that the value isn't what you might want during uninstallation, but it might be worth looking into.