Jump to content

Recommended Posts

I have an MSI file that I can't seem to force AutoIT to install... This is the code I eventually ended up using after digging through the forums:

#include <GUIConstants.au3>

GUICreate("Print On Demand", 400, 160)
GuiCtrlCreatePic("P:\PrintOnDemand\logo.jpg",20,20,353,39)
RunAsSet("user", "domain", "password")

$POD = GUICtrlCreateButton("Install Print on Demand", 20, 80)

GUISetState() ; display the GUI

GUISetState()

While 1

$MsiExec = StringUpper(@WindowsDir) & "\SYSTEM32\MSIEXEC /I "
$SMSPoint = "\\mysever\PrintOnDemand"

$msg = GUIGetMsg()

    Select
            Case $msg = $POD    
            Run($MsiExec & '"' & $SMSPoint & "PrintOnDemand.msi" & '"')
            RunAsSet()
            ExitLoop
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

When this code is run I get:

"This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer Package"

Running this from the commandline kicks it off fine though:

msiexec /i "\\myserver\PrintOnDemand\PrintOnDemand.msi"

Any ideas what is happening? I've tried a number of different methods but basically need runas functionality to kickoff this MSI.

Link to post
Share on other sites

#include <GUIConstants.au3>

GUICreate("Print On Demand", 400, 160)
GuiCtrlCreatePic("P:\PrintOnDemand\logo.jpg",20,20,353,39)
RunAsSet("user", "domain", "password")

$POD = GUICtrlCreateButton("Install Print on Demand", 20, 80)

GUISetState(); display the GUI

GUISetState()

While 1

$MsiExec = @SystemDir & "\MSIEXEC /i "
$SMSPoint = "\\mysever\PrintOnDemand"

$msg = GUIGetMsg()

    Select
            Case $msg = $POD    
            Run($MsiExec & '"' & $SMSPoint & "\PrintOnDemand.msi" & '"')
            RunAsSet()
            ExitLoop
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to post
Share on other sites

just a question... thats not

MSI.exe ???

i have an "instmsi.exe" on my computer

8)

<{POST_SNAPBACK}>

Adding to what Valuator said, change this and it should work (assuming all paths are correct).

$SMSPoint = "\\mysever\PrintOnDemand\"
Edited by SerialKiller
Link to post
Share on other sites

Lets make this a lot more simple:

RunAsSet("Administrator", @Computername, "password")
$this = 'C:\Windows\System32\msiexec.exe /i "P:\AppInstall\PrintOnDemand\PrintOnDemand.msi"'
Run($this)
RunAsSet()

Results in this from the Windows Installer: This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.

When I run this:

RunAsSet("Administrator", @Computername, "password")
FileChangeDir("P:\AppInstall\PrintOnDemand\")
$this = 'C:\Windows\System32\msiexec.exe /i "P:\AppInstall\PrintOnDemand\PrintOnDemand.msi"'
Run($this)
RunAsSet()

The script responds with:

Line 5 (File "C:\Documents and Settings\setup\Desktop\POD.au3"):

Run($this)

Error: Unable to execute the external program.

The directory name is invalid.

This code work flawlessly though!

$this = 'C:\Windows\System32\msiexec.exe /i "P:\AppInstall\PrintOnDemand\PrintOnDemand.msi"'
Run($this)
Link to post
Share on other sites

try running it manually from the command line (DOS window)

use windows "runas" utility...

<{POST_SNAPBACK}>

Thanks a lot for the reply!

I think you're on the right track and I get the same error using runas from the command line.

So am I stuck not being able to install MSI's as another user?

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...