sw3ng Posted October 13, 2015 Posted October 13, 2015 Hi everyone,This is my first post in this forum, as I have never been able to help anyone as I am a proper n00b on Autoit, nor have I had the need to ask about anything since this forum normally has all the answers (together with the help docs). Now, however, I dont know where to start. I have created a script that should run with defined account details, uninstall and install a software called 'therefore'. If I run the msi straight off as an admin, it works fine, by itself as well as with the added line /qb REMOTESERVER=MYSERVER, but when executing it with my script, it uninstalls the old version fine, also installs the prerequisite softwares fine but at the end I get the error on line 1277, Error parsing function call and I suspect that it has something to do with my specified parameters with msiexec.exe. I have tried to compile the script for both x86 and x64 but no luck. I have tried to specify working directory but that doesnt work at all. I tried to get information about what happens on line 1277 in the exe but I cant figure out how to catch that issue. Any help at all is very appreciated! This is my code, I have edited to keep out internal information.expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=Therefore 2015 Install_x86.exe #AutoIt3Wrapper_Outfile_x64=Therefore 2015 Install.exe #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Constants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> Global $userName = "USER" Global $password = "PASSWORD" Global $domain = "DOMAIN" $title = "Installerar Therefore 2015" $install_dir = "SERVERPATH\Therefore Client\" $prereq_dir = $install_dir & "Prerequisites\" ;MsgBox(0, "AutoIt is x64", @AutoItX64) SplashTextOn($title, "Avinstallerar klienten för 2012. Finns den inte installerad kommer en felruta att dyka upp, klicka OK för att gå vidare.", 400, 100, 50, 50) uninstall_2012() SplashOff() SplashTextOn($title, "Uppdaterar programbibliotek", 400, 100, 50, 50) installexe("dotNetFx40_Client_x86_x64.exe") installexe("vcredist2008SP1_x64.exe") installexe("vcredist2008SP1_x86.exe") installexe("vcredist2010SP1_x86.exe") installexe("vcredist2013_x64.exe") installexe("vcredist2013_x86.exe") installexe("vstor_redist.exe") SplashOff() SplashTextOn($title, "Installerar klienten för 2015", 400, 100, 50, 50) installmsi() SplashOff Func uninstall_2012() $uPid = RunAs($userName, $domain, $password, 1, 'msiexec.exe /x "SERVERPATH\Older versions\Therefore Client 64-Bit.msi" /qb /norestart', "") While ProcessExists($uPid) Sleep(50) WEnd EndFunc ;==>uninstall_2012 Func installexe($exetorun) $ePid = RunAs($userName, $domain, $password, 1, @ComSpec & $prereq_dir & $exetorun & "/qb /norestart", "") While ProcessExists($ePid) Sleep(50) WEnd EndFunc ;==>installexe ;I have tried to run just the install without the regkey if-statement. I have also tried: ;$iPid = RunAs($userName, $domain, $password, 1, 'msiexec.exe /i "SERVERPATH\Therefore Client\TheClientx64.msi" /qb REMOTESERVER=REMOTESERVERNAME') ;$iPid = RunAs($userName, $domain, $password, 0, 'msiexec.exe /i "SERVERPATH\Therefore Client\TheClientx64.msi" /qb REMOTESERVER=REMOTESERVERNAME', "", @SW_ENABLE) ;I suspect that it is "" '' or something like that that is ignoring the end of the msiexec-statement but apparently something is not done right. Func installmsi() $Reg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Therefore\Installation", "InstallVersion") if $Reg = "13.0.2" Then ;MsgBox(0,"","Therefore är redan installerat, reparerar.") $iPid = RunAs($userName, $domain, $password, 1, 'msiexec.exe /fvomus "SERVERPATH\Therefore Client\TheClientx64.msi" /qb REMOTESERVER=REMOTESERVERNAME', "", @SW_ENABLE) Else ;@error = 1 then ;MsgBox(0,"","Therefore är inte installerat, installerar.") $iPid = RunAs($userName, $domain, $password, 1, 'msiexec.exe /i "SERVERPATH\Therefore Client\TheClientx64.msi" /qb REMOTESERVER=REMOTESERVERNAME', "", @SW_ENABLE) EndIf While ProcessExists($iPid) Sleep(50) WEnd EndFunc ;==>installmsi(And the information given in splash screens is in sSwedish) Thanks!
Danp2 Posted October 13, 2015 Posted October 13, 2015 Take a look at using Au3Stripper with the MergeOnly option: https://www.autoitscript.com/wiki/AutoIt3Wrapper_DirectivesYou can examine the resulting file to see exactly which line is causing your error. sw3ng 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
sw3ng Posted October 13, 2015 Author Posted October 13, 2015 Take a look at using Au3Stripper with the MergeOnly option: https://www.autoitscript.com/wiki/AutoIt3Wrapper_DirectivesYou can examine the resulting file to see exactly which line is causing your error.THANK YOU!!! My last Splashoff was missing ()... I feel like such a knob...
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