Created
March 14, 2022 13:43
-
-
Save Gesugao-san/df9a2f4e4289dd94ec07e91db69a5dc9 to your computer and use it in GitHub Desktop.
For MongoDB Shell 5.2.1, https://mongodb.com/try/download/shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
CLS | |
@REM https://stackoverflow.com/a/41379378/8175291 | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
SETLOCAL ENABLEEXTENSIONS | |
SET DisplayVersion=5.2.1 | |
SET "DisplayName=MongoDB Shell %DisplayVersion%" | |
SET InstallDate=%date:~6,4%%date:~3,2%%date:~0,2% | |
SET "InstallLocation=%CD%" | |
SET "DisplayIcon=%CD%\mongosh.exe" | |
SET Publisher=MongoDB | |
SET "URLInfoAbout=https://mongodb.com/try/download/shell" | |
SET "HelpLink=%URLInfoAbout%" | |
SET "URLUpdateInfo=%URLInfoAbout%" | |
SET "Contact=%URLInfoAbout%" | |
SET "REG_PATH=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\mongosh" | |
@REM SET UninstallString=%CD%\uninstall.bat | |
@REM SET "list=%DisplayVersion% %DisplayName% %InstallDate% %Publisher% %URLInfoAbout% %HelpLink% %URLUpdateInfo% %Contact%" | |
ECHO "%DisplayName%", "%InstallDate%", "%InstallLocation%", "%DisplayIcon%" | |
REG ADD %REG_PATH% /v Contact /t REG_SZ /d %Contact% /f | |
REG ADD %REG_PATH% /v DisplayIcon /t REG_SZ /d "%DisplayIcon%" /f | |
REG ADD %REG_PATH% /v DisplayName /t REG_SZ /d "%DisplayName%" /f | |
REG ADD %REG_PATH% /v DisplayVersion /t REG_SZ /d %DisplayVersion% /f | |
REG ADD %REG_PATH% /v HelpLink /t REG_SZ /d %HelpLink% /f | |
REG ADD %REG_PATH% /v InstallDate /t REG_SZ /d %InstallDate% /f | |
REG ADD %REG_PATH% /v InstallLocation /t REG_SZ /d "%InstallLocation%" /f | |
REG ADD %REG_PATH% /v Publisher /t REG_SZ /d %Publisher% /f | |
REG ADD %REG_PATH% /v URLInfoAbout /t REG_SZ /d %URLInfoAbout% /f | |
REG ADD %REG_PATH% /v URLUpdateInfo /t REG_SZ /d %URLUpdateInfo% /f | |
IF ERRORLEVEL==0 (ECHO OK) ELSE (ECHO ERROR) | |
PAUSE | |
EXIT /B %ERRORLEVEL% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment