Jump to content

Error parsing function call

Recommended Posts


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.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=Therefore 2015 Install_x86.exe
#AutoIt3Wrapper_Outfile_x64=Therefore 2015 Install.exe
#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)

SplashTextOn($title, "Uppdaterar programbibliotek", 400, 100, 50, 50)

SplashTextOn($title, "Installerar klienten för 2015", 400, 100, 50, 50)

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)
EndFunc   ;==>uninstall_2012

Func installexe($exetorun)
    $ePid = RunAs($userName, $domain, $password, 1, @ComSpec & $prereq_dir & $exetorun & "/qb /norestart", "")
    While ProcessExists($ePid)
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)
    While ProcessExists($iPid)
EndFunc   ;==>installmsi

(And the information given in splash screens is in sSwedish) :)



Share this post

Link to post
Share on other sites

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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.