Thursday 21 July 2011

Installing msi with if condition using wise script - Important

Get Environment Variable programfiles into Variable PF
Get Registry Key SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{54DF35BD-4A36-35DA-B029-A0C083C88614} place in Variable DISPLAYNAME
If DISPLAYNAME Equals "Google Chrome" then
   Execute msiexec.exe /x {54DF35BD-4A36-35DA-B029-A0C083C88614} /qb! (Wait)
End
Execute %SYS32%\wscript.exe "%INST%\Delete profiles.vbs" (Wait)
Execute msiexec.exe /i "%INST%\Chrome Settings.msi" ALLUSERS="1" REBOOT="ReallySuppress" /qb! (Wait)
Execute %SYS32%\CMD.EXE /c  "%INST%\Chrome.bat" (Wait)
Delete File(s) %PF%\Google\Update\GoogleUpdate.exe

1 comment: