I have been running into an issue with a custom definition. I have attempted to create a msi upgrade patch for a custom application. I have not had any trouble with the detection logic, but for some reason the patch never installs the upgrade files, but reports success to the console.
I have been using the following script to install this software upgrade. I will state up front, that this script currently works normally as a software package and as running locally with an administrative user.
Option Explicit
Dim oExec, oShell
Set oShell = CreateObject("WScript.Shell")InstallWings
'=================================
' Subroutines and Functions
'=================================Sub Sleep
'subroutine to pause execution of script until current installation process is completed
Do While oExec.Status = 0
wscript.sleep 100
Loop
End SubSub InstallWings
'install Wings client
Set oExec = oShell.Exec("msiexec.exe /i "\\server\share\myFile.msi" REINSTALL=ALL REINSTALLMODE=vomus /quiet")
Sleep
End Sub
When I attempted to incorporate this script into the custom definition, I used the option 'Run Script' > VBScript, then pasted the above script into the editor, adding the additional function that is mentioned in the sample script that is created when you create a 'Run Script' patch action.
Dim oExec, oShell, bSucceeded, strMessage
Set oShell = CreateObject("WScript.Shell")InstallWings
ReportRepairResult true, "Message reported to core"'========================
' Subroutines and Functions
'========================Sub Sleep
'subroutine to pause execution of script until current installation process is completed
Do While oExec.Status = 0
wscript.sleep 100
Loop
End SubSub InstallWings
'install Wings client
Set oExec = oShell.Exec("msiexec.exe /i ""\\server\share\myFile.msi"" REINSTALL=ALL REINSTALLMODE=vomus /quiet")
Sleep
End SubSub ReportRepairResult(Boolean bSucceeded, String strMessage)
When this script was run, the repair fails, with error 412.
What am I doing incorrectly? I would much rather keep this as a single action instead of using the custom definition to define the target for another software distribution task. With the installation parameters of REINSTALL=ALL and REINSTALLMODE=vomus, the installer msi for the installed version being upgraded, needs to be in the same location as the upgrading msi file, so this complicates the patch installation process.