MSI deinstall / install / log over network
Hi folks!
Im trying to deploy and delete a MSI over a logon script which pushs my own process/script.
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)
till now:
@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,
newbie85
Im trying to deploy and delete a MSI over a logon script which pushs my own process/script.
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)
till now:
@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,
newbie85
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
Posted by:
newbie85
13 years ago
Thx for your fast reply VBScab!
I will now using VBS. I need to now how to install or deinstall a msi and also how2 write a log?
something like:
------
msiCodeInstall = "{00000000-0000-0000-0000-000000000000}"
msiCodeDenstall = "{00000000-0000-0000-0000-000000000000}"
ReturnDeinstall = WshShell.Run("msiexec.exe /x" & msiCodeDenstall & " /qb!", 1, true)
--> write log deinstallation successfull or failed
ReturnInstall = WshShell.Run("msiexec.exe /i" & msiCodeInstall & " /qb!", 1, true)
If ReturnInstall <> 0 or ReturnInstall <> 3010
->> write log success
else
->> write log fail
End If
logfile should be the same file..
----
sorry for the obscure informations :S
I will now using VBS. I need to now how to install or deinstall a msi and also how2 write a log?
something like:
------
msiCodeInstall = "{00000000-0000-0000-0000-000000000000}"
msiCodeDenstall = "{00000000-0000-0000-0000-000000000000}"
ReturnDeinstall = WshShell.Run("msiexec.exe /x" & msiCodeDenstall & " /qb!", 1, true)
--> write log deinstallation successfull or failed
ReturnInstall = WshShell.Run("msiexec.exe /i" & msiCodeInstall & " /qb!", 1, true)
If ReturnInstall <> 0 or ReturnInstall <> 3010
->> write log success
else
->> write log fail
End If
logfile should be the same file..
----
sorry for the obscure informations :S
Posted by:
anonymous_9363
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.