Tuesday, May 14, 2019

Docker for windows

I followed the approach of silent installation and uninstallation.
Reference

For installation:

@echo off
set APPLICATION_NAME=Docker for Windows 2.0.0.31259
set PACKAGE_NAME=Docker_for_Windows_2.0.0.31259_P1
echo ****************************************
echo 
echo Installation for %APPLICATION_NAME%
echo ****************************************

echo Installing %APPLICATION_NAME%
"%~dp0Docker for Windows Installer.exe" install --quiet

if not %ERRORLEVEL%==0 goto FAILED

echo Audit Key
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Installed Applications" /v "%PACKAGE_NAME%" /t REG_SZ /d "Installed: %date%, %time%" /f
:SUCCESS
echo  %date% %time% "Installation successful" >> "C:\windows\temp\Microsoft Visio Professional 2016_Install.log"

GOTO END


:FAILED

echo "Installation failed with error code %ERRORLEVEL%" >> "C:\windows\temp\Microsoft Visio Professional 2016_Install.log"

exit /b %ERRORLEVEL%

:END


For uninstallation:

@echo off
set APPLICATION_NAME=Docker for Windows 2.0.0.31259
set PACKAGE_NAME=Docker_for_Windows_2.0.0.31259_P1
echo ******************************************
echo 
echo Uninstallation for %APPLICATION_NAME%
echo ******************************************

echo Un-Installing %APPLICATION_NAME%
"C:\Program Files\Docker\Docker\Docker for Windows Installer.exe" uninstall --quiet

echo Audit Key
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Installed Applications" /v "%PACKAGE_NAME%" /f


No comments:

Post a Comment