Hi folks!
Im trying to deploy and delete a MSI over a logon script which pushs my own VBScript.
The solution should do the following steps:
1. DeInstall MSI from Machine
2. Log the success of the deinstallation
3. Install the new MSI on the Machine
4. Log the success of the installation
5. reboot if required
(everything in the background - silent)
Ive created a batch file to do this but Ive heard that it would be better to use VBS because it offers more possibilities.
@echo off
SET ProductCodeToInstall={4F34C602-4D6D-470D-A2A0-59E4F25DDBF22}
SET ProductCodeToRemove={26A24AE4-039D-4CA4-87B4-2F83216022FF}
reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductCodeToRemove%" /v DisplayName
IF %ERRORLEVEL%==0 (
echo msiexec /qn /x %ProductCodeToRemove% REBOOT=R
echo %DATE% %TIME% %ProductCodeToRemove% removed...>>%COMPUTERNAME%.log
)
reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductCodeToInstall%" /v DisplayName
IF NOT %ERRORLEVEL%==0 (
echo msiexec /qn /i "%ProductToInstall%" REBOOT=R
IF NOT %ERRORLEVEL%==0 (
IF NOT %ERRORLEVEL%==3010 (
echo %DATE% %TIME% %ProductToInstall% failed...>>%COMPUTERNAME%.log
)
echo %DATE% %TIME% %ProductToInstall% installed...>>%COMPUTERNAME%.log
)
echo %DATE% %TIME% %ProductToInstall% installed...>>%COMPUTERNAME%.log
)
Can you guys give me some feedback?
Regads,
newbie
Im trying to deploy and delete a MSI over a logon script which pushs my own VBScript.
The solution should do the following steps:
1. DeInstall MSI from Machine
2. Log the success of the deinstallation
3. Install the new MSI on the Machine
4. Log the success of the installation
5. reboot if required
(everything in the background - silent)
Ive created a batch file to do this but Ive heard that it would be better to use VBS because it offers more possibilities.
@echo off
SET ProductCodeToInstall={4F34C602-4D6D-470D-A2A0-59E4F25DDBF22}
SET ProductCodeToRemove={26A24AE4-039D-4CA4-87B4-2F83216022FF}
reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductCodeToRemove%" /v DisplayName
IF %ERRORLEVEL%==0 (
echo msiexec /qn /x %ProductCodeToRemove% REBOOT=R
echo %DATE% %TIME% %ProductCodeToRemove% removed...>>%COMPUTERNAME%.log
)
reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductCodeToInstall%" /v DisplayName
IF NOT %ERRORLEVEL%==0 (
echo msiexec /qn /i "%ProductToInstall%" REBOOT=R
IF NOT %ERRORLEVEL%==0 (
IF NOT %ERRORLEVEL%==3010 (
echo %DATE% %TIME% %ProductToInstall% failed...>>%COMPUTERNAME%.log
)
echo %DATE% %TIME% %ProductToInstall% installed...>>%COMPUTERNAME%.log
)
echo %DATE% %TIME% %ProductToInstall% installed...>>%COMPUTERNAME%.log
)
Can you guys give me some feedback?
Regads,
newbie