I'm trying to create this installer with Wix. Before or after InstallFinalize, I need to get the msi file name and then write that file name to config file inside the installation directory. Is this something possible?
Asked
Active
Viewed 2,287 times
2 Answers
4
The Windows Installer property OriginalDatabase has the path and name of the MSI database. You'll have to parse out the name from the path. WiX's util extension then has custom actions for configuring XML files.

Christopher Painter
- 54,556
- 6
- 63
- 100
-
I see. But how would you use this property like for example in vbs? – user1402330 May 18 '12 at 04:16
-
1Your question didn't mention VBScript. If it had, I would have warned you that you shouldn't be using them in the first place. http://blogs.msdn.com/b/robmen/archive/2004/05/20/136530.aspx – Christopher Painter May 18 '12 at 11:15
4
You can access a property in VBS like this:
Dim propValue = Session.Property("OriginalDatabase")
Also, very important, make sure the custom action is immediate. You cannot execute the above from a deferred custom action.
However, I recommend Win32 DLL for a custom action. In it you can use Windows API to read the property value.

Bogdan Mitrache
- 10,536
- 19
- 34
-
Thank you very much man! I now got it. I'm such a noob when it comes to vbs and didn't even know how to use Windows global variables. – user1402330 May 18 '12 at 08:46