Jump to content

running msiexec without exact path


MCT
 Share

Recommended Posts

the only way im able to execute an msi + parameters is to use an exact path, but id rather replace c:\windows with @Windowsdir so its less machine dependant

my current code is:

$CD = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup", "SourcePath")
If FileExists(@SystemDir & '\vmx_mode.dll') = 0 Then
    RunWait($CD & '\Install\Apps\Vmware\Vmwaretools.exe')
    Sleep(2000)
    RunWait(msiexec /i @WindowsDir & '"\Temp\VmwareTools.msi" /qn Reboot=ReallySuppress')
ElseIf FileExists(@SystemDir & '\vmx_mode.dll') = 1 Then 
    Exit
    RunWait(/msiexec /i $CD & '"\Install\Apps\Vmware\VMware.msi" /Qn TARGETDIR="%ProgramFiles%\VMware" ADDLOCAL=ALL DISABLE_AUTORUN=0 DESKTOP_SHORTCUT=0 SERIALNUMBER=XXXX-XXXX-XXXX-XXXX USERNAME=Administrator')
    RunWait('"REGEDIT.EXE" /S %Cdrom%\Install\Reg\Vmware.reg')
EndIf

the above code as i said doesnt work, i have to replace the variables with exact path, can some1 help please :P

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...