user1402330
user1402330

Reputation: 1

Wix Custom Action get current running msi file name

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?

Upvotes: 0

Views: 2433

Answers (2)

Bogdan Mitrache
Bogdan Mitrache

Reputation: 11023

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.

Upvotes: 4

Christopher Painter
Christopher Painter

Reputation: 55601

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.

Upvotes: 4

Related Questions