codemonk3y
Posts: 62
Joined: Thu Nov 01, 2012 3:51 pm

Update deployed msi properties

We have 2 msi files. One is for the client to download and the other is for the update site that contains the first one.

When have multiple regions and when the update site lays down the msi we use a vbs custom action to set the 'INSTALLTOREGION' property so when the client gets the update the correct config files are installed. On Windows Server 2016 the vbs doesn't always run because of admin rights. If I run the install with an admin console it installs fine, but otherwise it errors. Below is the vbs code i wrote a couple years ago and has been fine since this server move. Is there a better way to do this? We're using AI 14.0.2

Code: Select all

'get the passed in variables
customactiondata = Session.Property("CustomActionData")
actiondata = Split(customactiondata, "|")

'check if the msi is there
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(actiondata(1) & "\MyInstall.msi")) Then
	set o_installer = CreateObject("WindowsInstaller.Installer")
	set o_database = o_Installer.OpenDatabase(actiondata(1) & "\MyInstall.msi", 1)
	
	'set the installtoregion
	Set o_MSIView = o_database.OpenView("UPDATE Property SET Value = '" & actiondata(0) & "' WHERE Property = 'INSTALLTOREGION'")
	o_MSIView.Execute
		
	o_DataBase.Commit
Else
	return 1
End If
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Update deployed msi properties

Hello,

To be fully honest with you, I don't see a problem with the script itself. I am thinking that this might be an environment issue.

Does this problem occur on other machines as well? For instance, Win8, Win10?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”