Jump to content

Recommended Posts

Posted

Hello,

I am trying to run an msi with autoit and pass through a parameter "TARGETDIRECTORY". The installer is not running correctly and I could do with an expert's opinion as I am a novice. I've had success with this type of script before.

 

; Fill in the username and password appropriate for your system.
Local $sUserName = "Redacted"
Local $sPassword = "Redacted"
Local $sDomain = "Redacted"

; Check for flag to indicate files already copied up
If FileExists("C:\IT\SCCM\FlagFiles\ICWAddinInstalled.flg") Then
   Exit
EndIf

RunAsWait($sUserName, $sPassword, $sDomain, 0, 'msiexec /i "RedactedFilepath\CivicaOfficeAddinSetup.msi" /qb TARGETDIR="C:\Program Files (x86)\Civica\CivicaOfficeAddin\"')

; Create flag file
$file = FileOpen("C:\IT\SCCM\FlagFiles\ICWAddinInstalled.flg", 10)
   FileWriteLine($file, "Done")
   FileClose($file)

$msgbox = MsgBox(0, "Add-in Install Complete", "Clicking OK will open up the addin configuration document")

ShellExecute("RedactedSharepointURL")

Exit

Any help would be appreciated, thank you.

Posted
3 hours ago, Hackarin said:

Any help would be appreciated, thank you.

As @Danp2 said, check the order :

The first three parameters should be RunAsWait ( "username", "domain", "password", ... not RunAsWait($sUserName, $sPassword, $sDomain,...  ;)

 

Posted

Thank you Danp2, that's resolved by issue above. I will be logging another ticket relating to the next part. Wasn't sure how I broken this but must have messed up the order haha

Posted

Get your MSI command to work from the command line in a test environment and once you have the exact command line, you can use it in your code, providing that the double quotes are where they’re supposed to be

My resources are limited. You must ask the right questions

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...