Sign in to follow this  
Followers 0
GeekOrGuru

EXE Installation Issues

7 posts in this topic

Please forgive me in advance! I admit it...I'm a total NOOB!

Anyways, my ultimate objective is to install an application with Admin rights which is located on one of our APP servers.

I cannot run it as a scheduled task w/Admin rights at the moment and I cannot run it as a batch script due to permissions issues, so that leads me here where all the smart people are hanging out!

Here is the logon script which will be ran w/User rights:

@ECHO OFF
IF EXIST %SYSTEMDRIVE%\HEAVYBID\NUL GOTO UPDATE
GOTO INSTALL

    :INSTALL
        L:\HEAVYBID\Scripts\wsinstscript.exe
        GOTO END
        
    :UPDATE
        L:\HEAVYBID\Scripts\wsupdatescript.exe
        GOTO END

    :END    
        END IF

EXIT

I'm trying to make "wsinstscript.exe" and "wsupdatescript.exe" compiled AutoIt scripts w/RunAs() permissions.

This is where the confusion starts as it will not execute when I go to Tools>Go.

RunAS("ScriptAdmin", "HUTCHENS", "PASSWORD", 4, "L:\HEAVYBID\wsinst.exe")

This will execute when I go to Tools>Go.

Run("L:\HEAVYBID\wsinst.exe")

I've even tried using the AutoIt Recorder and once complete it will not execute when I go to Tools>Go.

#region --- Au3Recorder generated code Start ---

Run('L:\HEAVYBID\wsinst.exe')
_WinWaitActivate("HeavyBid 2010.0.1  Workstation Install","")
Send("{ENTER}{ENTER}{ENTER}{ENTER}")
_WinWaitActivate("Sentinel HASP Run-time Environment Installer v. 5.86","")
Send("{ENTER}")
_WinWaitActivate("HeavyBid 2010.0.1  Workstation Install","")
Send("{ENTER}")
")

#region --- Internal functions Au3Recorder Start ---
Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc
#endregion --- Internal functions Au3Recorder End ---

#endregion --- Au3Recorder generated code End ---
#endregion --- Au3Recorder generated code End ---

Can anyone HELP a lost soul please!!!

Share this post


Link to post
Share on other sites



Try using ShellExecute instead of Run

and use ControlSend instead of Send. Use AutoIt Info tool to get the class of each button.


First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. -George Carrette[sub]GD Keylogger Creator (never released)[/sub][sub]Garena Autojoin v3.0[/sub]

Share this post


Link to post
Share on other sites

Try using ShellExecute instead of Run

and use ControlSend instead of Send. Use AutoIt Info tool to get the class of each button.

Thanks...I assume you're referring to the "Recorder" script. I'll try that, but how will that elevate the privileges? I ultimately need to run w/Admin rights.

Share this post


Link to post
Share on other sites

Try using ShellExecute instead of Run

and use ControlSend instead of Send. Use AutoIt Info tool to get the class of each button.

Thanks...I assume you're referring to the "Recorder" script. I'll try that, but how will that elevate the privileges? I ultimately need to run w/Admin rights.

Share this post


Link to post
Share on other sites

OK...my script has evolved and is still evolving, but here is where I'm at.

#Region -- Variables --
$sUserName = "UserName"
$sPassword = "Password"
$sDomain = "Domain"
$sHB_DriveLetter = "L:"
$sHB_SharePath = "\\APP03\HEAVYBID"
$sHB_WSINSTPath = $sHB_DriveLetter & "\HEAVYBID\wsinst.exe"
$sHB_WSUPDATEPath = $sHB_DriveLetter & "\HEAVYBID\wsupdate.exe"
$sHB_CRYSTALRUNTIMEPath = $sHB_DriveLetter & "\HEAVYBID\Crystal11Runtime.msi"

#Region -- Map Drive --
DriveMapAdd($sHB_DriveLetter, $sHB_SharePath, "", $sDomain & "\" & $sUserName, $sPassword)

#Region -- HeavyBid Installation --
ShellExecute($sHB_WSINSTPath)
WinWaitActive("HeavyBid", "This program will in")
Send("{ENTER}")
WinWaitActive("HeavyBid", "A workstation instal")
Send("{ENTER}")
WinWaitActive("HeavyBid", "If you want to chang")
Send("{ENTER}")
WinWaitActive("HeavyBid", "Click Install to beg")
Send("{ENTER}")
WinWaitActive("HCSS - Crystal XI Integration","")
WinClose("HCSS - Crystal XI Integration","")
WinWaitActive("Sentinel HASP Run-time Environment Installer","")
WinClose("Sentinel HASP Run-time Environment Installer","")
WinWaitActive("HeavyBid", "The InstallShield Wi")
Send("{ENTER}")
WinWaitActive("classname=DlgcacClsName", "")
Send("{ENTER}")

#Region -- Crystall Runtime Installation --
Run($sHB_CRYSTALRUNTIMEPath)
WinWaitActive("Crystal 11 - HCSS Integration","Welcome to the Cryst")
Send("{ENTER}")
WinWaitActive("Crystal 11 - HCSS Integration","Confirm Installation")
Send("{ENTER}")
WinWaitActive("Crystal 11 - HCSS Integration","Installation Complet")
Send("{ENTER}")

DriveMapDel($sHB_DriveLetter)

Exit

I was never able to successfully pass Admin credentials to the HeavyBid installation.exe, but it does run with PowerUser rights and my script exits out of the errors. In order to correct those errors I need to install the Crystal.msi.

I have tried running the Crystal.msi with ShellExecute() as well as Run(), but it doesn't appear that my script ever makes it to that point (it just hangs after completing the HeavyBid installation).

I can successfully run this by itself and under PowerUser rights.

#Region -- Variables --
$sUserName = "UserName"
$sPassword = "Password"
$sDomain = "Domain"
$sHB_DriveLetter = "L:"
$sHB_SharePath = "\\APP03\HEAVYBID"
$sHB_WSINSTPath = $sHB_DriveLetter & "\HEAVYBID\wsinst.exe"
$sHB_WSUPDATEPath = $sHB_DriveLetter & "\HEAVYBID\wsupdate.exe"
$sHB_CRYSTALRUNTIMEPath = $sHB_DriveLetter & "\HEAVYBID\Crystal11Runtime.msi"

#Region -- Map Drive --
DriveMapAdd($sHB_DriveLetter, $sHB_SharePath, "", $sDomain & "\" & $sUserName, $sPassword)

#Region -- Crystall Runtime Installation --
Run($sHB_CRYSTALRUNTIMEPath)
WinWaitActive("Crystal 11 - HCSS Integration","Welcome to the Cryst")
Send("{ENTER}")
WinWaitActive("Crystal 11 - HCSS Integration","Confirm Installation")
Send("{ENTER}")
WinWaitActive("Crystal 11 - HCSS Integration","Installation Complet")
Send("{ENTER}")

DriveMapDel($sHB_DriveLetter)

Exit

Can anyone enlighten me on why my script is not transitioning correctly between the two installs?

Also, I've tried it with and without the drive mapped w/Admin credentials. I'm not positive, but I think that I can get rid of this part of my code since the drive is mapped via Group Policy for the currently logged on user.

Please help...I'm close, so close. And, I've learned so much in just the last two or three days!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

try change "Run" with "RunAs" user with install privilege

correct me if wrong,,, you want to install this msi in your local or push it to remote computer?

if you want in local computer with msi from other computer,,, then i think you only need to change Run to RunAs.

if push it to remote computer,,, you need other method,,, example: psexec.

Edited by rvn

Share this post


Link to post
Share on other sites

try change "Run" with "RunAs" user with install privilege

correct me if wrong,,, you want to install this msi in your local or push it to remote computer?

if you want in local computer with msi from other computer,,, then i think you only need to change Run to RunAs.

if push it to remote computer,,, you need other method,,, example: psexec.

The msi is stored and executed from the APP server. I can execute it from a command line, run box, or Win Explorer.

I tried the RUNAS and still no go. I don't know what it is, but it doesn't appear that the correct credentials are being passed from AutoIT for RUNAS, but they are working when I map a drive.

If I could just figure out what is holding up the transition in the script then SHELLEXECUTE is working for me.

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
Sign in to follow this  
Followers 0