FredrikBostrom Posted October 26, 2012 Share Posted October 26, 2012 Hi,I´m trying to install an application on several client computers using runaswait().I´m getting Windows installer error 2103.26 when I´m starting the installer.exe using runaswait() as local administrator.I know that I´m getting local administrative access to the computer.The command used is: RunAsWait($sUserName, $sComputerName, $sCurrentPwd, 1, "\\wfalkemsr001\hemlopa\Lmd\Scripts\" & $sApp & "\" & "install_" & $sApp & ".exe", "")This error only show when the user logged on to the computer is a domain user (AD). If the user is logged on with a local user account the application installs fine. I have to set the logon_flag to 1 otherwise it won´t work at all.I googled it and came up with this:http://msdn.microsoft.com/en-us/library/aa372835.aspxand this:http://kb.flexerasoftware.com/selfservice/viewContent.do?externalID=Q107092They both say that this has to do with "resolving paths for shell folders".This is where my knowledge ends and I need your help!Best regards,Fredrik Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 26, 2012 Moderators Share Posted October 26, 2012 Hi, FredrikBostrom, welcome to the forum. As a long-time application packager, this error is something you see more than you would care to The #1 reason it will throw this error is if you're using an account that does not have proper access to the install location. You mention that you're running as the local administrator account, yet it appears you are pulling your install from a network location. Unless you've done something fancy, the local admin account isn't going to be able to access this location. Your alternative, if you are in a domain environment, is to set up a Service Account in Active Directory. One that you would use for all of your software installs. Then you could add this service account to the local admins group on the computer(s), and store your installs in a central repository where the service account has full access. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
FredrikBostrom Posted October 29, 2012 Author Share Posted October 29, 2012 Hi, and thank you! I managed to get rid of the 2103-error. What I have done now is that use a different approch to getting admin-access to the computer. I now execute runaswait() with a domian account that has admin-rights on every client locally and enough rights on involved network shares. I still get som very strange behavior from the installer exe. First of all....when I run the installer.exe without the use of Autoit-scripts it installs as it is supposed to. It creates a directory (c:analytix) and copy files to it and then it creates a sub directory (c:analytixtemp). It then launches another installation (Crystal reports). When I try to start the installation using my Autoit-script and Runaswait() the installer starts and the directory (c:analytix) is created. Files are copied to the directory. The problem is that the sub directory (c:analytixtemp) is never created (which is needed for the app to run) and some of the files which reside in a subdirectory of the installers path are never copied either. With installers path I mean the network share where I start the installer.exe from. The installer.exe has an ini-fil where the installer reads some settings from. This ini-file is located in the same directory as the installer.exe. It seems as if the installer never reads the ini-file when it is executed with Autoit-script with runaswait(). I´m starting to think that all of the above problems has to do with the installer not being able to read from the installer.exe path (network share) properly. Or maybe the problem has to do with logged in user profile collision with runaswait() user and profile.... I´m so close to get this to function properly. (More) help is needed! Best regards, Fredrik Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 29, 2012 Moderators Share Posted October 29, 2012 Can you please post your code, so we can take a look? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
FredrikBostrom Posted October 30, 2012 Author Share Posted October 30, 2012 (edited) The code is partially bits and pieces from code snippets that I found on forums so I´ll take this opportunity to thank those who recognize pieces of their code. Here´s the "main script" that runs first. This script runs in the autostart folder on every client. It checks a database if a program installation is to be executed on the machine using its computername. If so, the "install script (see below) is executed using a domain account that has admin rights locally and enough rights on the involved network shares from where it reads the installer.exe. If the installation is succesful the script writes "2" to a field in the database and if not succesful (working on how to handle it) it writes "9" to the field in the database. It then shows a msgbox displaying the result to the user. expandcollapse popup#include-once Local $sComputerName = @ComputerName Local $RunResult Local $oRS = ObjCreate("ADODB.Recordset") Local $sQuery = "SELECT * FROM att_installera WHERE datornamn = '" & $sComputerName & "'" $oRS = _SQLQuery(_SQLConnect("wfalkemsr005", "natverksenhet", 1, "lmd_read", "edimed12", "{SQL Server}"), $sQuery) ;Hantering av recordset $oRS. Om det är tom avslutas scriptet, om inte så kontrolleras varje kolumn om de innehåller "1". ;I så fall läses kolumnnamnet (vilket är programnamnet) och installation av detta inleds. Då installationen har gått färdigt ;skrivs "2" i fältet om installationen lyckats. Om något gått fel skrivs "9". If Not $oRS.RecordCount = 0 Then For $oField in $oRS.Fields If $oField.Name <> "datornamn" Then If $oRS.Fields($oField.Name).Value = 1 Then $RunResult = _InstallApp($oField.Name) If $RunResult = 0 Then _SQLQuery(_SQLConnect("wfalkemsr005", "natverksenhet", 1, "*******", "*******", "{SQL Server}"), "UPDATE att_installera SET " & $oField.Name & " = 2 WHERE datornamn = '" & $sComputerName & "'") ElseIf $RunResult <> 0 Then _SQLQuery(_SQLConnect("wfalkemsr005", "natverksenhet", 1, "*******", "*******", "{SQL Server}"), "UPDATE att_installera SET " & $oField.Name & " = 9 WHERE datornamn = '" & $sComputerName & "'") EndIf EndIf EndIf Next ;Meddelande till användaren att programinstallationen är avslutad, lyckad eller misslyckad. If $RunResult = "0" Then MsgBox(64, "Lyckad programinstallation", "Programinstallationen var lyckad och är avslutad." & @CRLF & @CRLF & "Du bör nu starta om datorn.", 15) ElseIf $RunResult <> 0 Then MsgBox(64, "Misslyckad programinstallation", "Programinstallationen misslyckades och är avslutad." & @CRLF & @CRLF & "Kontakta någon på LmD-IT." & @CRLF & @CRLF & "Du bör nu starta om datorn.", 15) Exit EndIf EndIf If $oRS.RecordCount = 0 Then Exit EndIf ;Funktion för koppling mot databasen och skapande av connection-object Func _SQLConnect($sServer, $sDatabase, $fAuthMode = 0, $sUsername = "", $sPassword = "", $sDriver = "{SQL Server}") Local $sTemp = StringMid($sDriver, 2, StringLen($sDriver) - 2) Local $sKey = "HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INIODBC Drivers", $sVal = RegRead($sKey, $sTemp) If @error or $sVal = "" Then Return SetError(2, 0, 0) $oConn = ObjCreate("ADODB.Connection") $oConn.CursorLocation = 3 If NOT IsObj($oConn) Then Return SetError(3, 0, 0) If $fAuthMode Then $oConn.Open ("DRIVER=" & $sDriver & ";SERVER=" & $sServer & ";DATABASE=" & $sDatabase & ";UID=" & $sUsername & ";PWD=" & $sPassword & ";") If @error Then Return SetError(1,0,0) If NOT $fAuthMode Then $oConn.Open("DRIVER=" & $sDriver & ";SERVER=" & $sServer & ";DATABASE=" & $sDatabase) If @error Then Return SetError(1,0,0) Return $oConn EndFunc ;Funktion för SQL-frågan Func _SQLQuery($oConn, $sQuery) If IsObj($oConn) Then Return $oConn.Execute($sQuery) Return SetError(1, 0, 0) EndFunc ;Funktion för att initiera installation av aktuella program. Denna funktion kör installationsskript som Administratör. Func _InstallApp($sApp) RunAsWait("******", "*******", "********", 1, "wfalkemsr001hemlopaLmdScripts" & $sApp & "" & "install_" & $sApp & ".exe", "") EndFunc And here´s the "per application to install" -script for one of the applications (Analytix) to install (the one that threw the Installer error in previous post). This script is called from the "main script" and is run as administrator using RunAsWait() as stated above. It turns off the "file security popup" in windows xp during the install and then enables it again after the script is finished. It runs the installer.exe from a network share using runwait(). I have tried with many different "working dirs" and none is affecting the outcome og the installation. The problems in the posts above remains. expandcollapse popup;************************************* ;**** Installera CGM Analytix 5.4 **** ;************************************* ;Om systemet är 64-bitars sätts $i64Bit till "64" Local $i64Bit = "" If @OSArch = "X64" Then $i64Bit = "64" EndIf _ProgressBar("Analytix", 0, "Ändrar tillfälligt registernyckeln '1806' till '0'") ;Ändra tillfälligt registernyckeln "1806" till "0" RegWrite("HKEY_CURRENT_USER"& $i64Bit & "SoftwareMicrosoftWindowsCurrentVersionInternet SettingsZones3", "1806", "REG_DWORD", "0") _ProgressBar("Analytix", 30, "Installerar Analytix") ;Kör installationsfilen RunWait("wfalkemsr002analytixinstallinstall.exe /s") _ProgressBar("Analytix", 60, "Återställer registernyckeln '1806' till '1'") ;Kopiera filer till c:analytix som inte installationsprogrammet klarar av när det är scriptat FileCopy("wfalkemsr002analytixini*.*", "c:analytix*.*", 1) FileCopy("wfalkemsr002analytixinstalldllliddefaultlid.dll", "c:analytix*.*", 1) FileCopy("wfalkemsr002analytixinstalldllpexdefaultpex32.dll", "c:analytix*.*", 1) FileCopy("wfalkemsr002analytixinstalldllpidswepid32.dll", "c:analytix*.*", 1) FileCopy("wfalkemsr002analytixinstalldllrexdefaultrex.dll", "c:analytix*.*", 1) FileCopy("wfalkemsr002analytixinstalldlltimegeneraltime32.dll", "c:analytix*.*", 1) ;Radera vers.ini från c:analytix FileDelete("c:analytixVers.ini") ;Återställ registernyckeln "1806" till "1" RegWrite("HKEY_CURRENT_USER"& $i64Bit & "SoftwareMicrosoftWindowsCurrentVersionInternet SettingsZones3", "1806", "REG_DWORD", "1") _ProgressBar("Analytix", 80, "Kopierar ut genväg på skrivbordet") ;Kopiera ut en genväg till Analytix hjälpfil på skrivbordet för All-users FileCopy("wfalkemsr002analytixinstallAnalytix_Hjälp.lnk", "C:Documents and SettingsAll UsersSkrivbord") _ProgressBar("Analytix", 100, "Installationen slutförd") ;Funktion för progressbar under installationsförloppet Func _ProgressBar($sApp, $iCnt, $sJob) If $iCnt = 0 Then ProgressOn("Programinstallation", $sApp & " installeras på datorn. Vänta...", "", -1, 200) ProgressSet($iCnt, $sJob) ;ProgressSet($iCnt, $iCnt & " procent färdigt", $sJob) ElseIf $iCnt > 0 And $iCnt < 100 Then ProgressSet($iCnt, $sJob) ;ProgressSet($iCnt, $iCnt & " procent färdigt", $sJob) ElseIf $iCnt = 100 Then ProgressSet($iCnt, $sJob, "Analytix är nu installerat!") Sleep(5000) ProgressOff() EndIf EndFunc I was forced to do the "file copy" -part to copy the files that the installer won´t copy when run using autoit runaswait(). But that doesn´t solve the problem with the installer not creating the temp directory etc... PS. As you can se I am not a professional coder so I´m very much aware that the code can be done so much better and nicer but this is what I´m able to produce with my curreny programming skills. Best regards, Fredrik Edited October 30, 2012 by FredrikBostrom Link to comment Share on other sites More sharing options...
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