Hackarin Posted July 7, 2023 Posted July 7, 2023 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.
Solution Danp2 Posted July 7, 2023 Solution Posted July 7, 2023 Check the order of your parameters for the RunAsWait command. 😉 Latest Webdriver UDF Release Webdriver Wiki FAQs
Guest Posted July 7, 2023 Posted July 7, 2023 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,...
Hackarin Posted July 7, 2023 Author Posted July 7, 2023 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
Earthshine Posted July 7, 2023 Posted July 7, 2023 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now