Skip to content

Instantly share code, notes, and snippets.

@hnuzhoulin
Forked from engalar/README.md
Created July 24, 2022 14:34
Show Gist options
  • Save hnuzhoulin/af04507ab264fa94830cb2071b096fc1 to your computer and use it in GitHub Desktop.
Save hnuzhoulin/af04507ab264fa94830cb2071b096fc1 to your computer and use it in GitHub Desktop.
mendix offline install

使用方法

运行效果

Active code page: 65001
已经存在 listing.txt

请选择一个你想要安装的Studio Pro版本号?
[162] 9.9.2.35886
例如你输入162表示安装9.9.2.35886

[1] 9.9.3.49292.tar.gz
[2] 9.9.4.49292.tar.gz

?1

你选择安装 9.9.3.49292
下载文件 https://mirrors.tuna.tsinghua.edu.cn/Adoptium/11/jdk/x64/windows/OpenJDK11U-jdk_x64_windows_hotspot_11.0.15_10.msi 到 ./Dependencies/adoptopenjdk_11_x64.msi
下载文件 https://artifacts.rnd.mendix.com/native-builders/latest.exe 到 ./Dependencies/mendix_native_mobile_builder.exe
下载文件 https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe 到 ./Dependencies/credist2010_x64.exe
下载文件 https://aka.ms/vs/16/release/vc_redist.x64.exe 到 ./Dependencies/credist2019_x64.exe
下载文件 https://download.visualstudio.microsoft.com/download/pr/5681bdf9-0a48-45ac-b7bf-21b7b61657aa/bbdc43bc7bf0d15b97c1a98ae2e82ec0/windowsdesktop-runtime-6.0.5-win-x64.exe 到 ./Dependencies/windowsdesktop-runtime-6.0.3-win-x64.exe
下载文件 https://artifacts.rnd.mendix.com/modelers/Mendix-9.9.3.49292-Setup.exe 到 ./Mendix-9.9.3.49292-Setup.exe

下载结果

Folder PATH listing for volume Seagate Expansion Drive
Volume serial number is AA88-6B59
D:.
│   listing.txt
│   Mendix-9.9.3.49292-Setup.exe
│   mendix_offline_install.bat
│
└───Dependencies
        adoptopenjdk_11_x64.msi
        credist2010_x64.exe
        credist2019_x64.exe
        mendix_native_mobile_builder.exe
        windowsdesktop-runtime-6.0.3-win-x64.exe

@echo off
chcp 65001
SETLOCAL
set CDN_BASE_URL=https://artifacts.rnd.mendix.com
@REM begin version ==========================================================================
setlocal enabledelayedexpansion
CALL :ensure_file https://cdn.mendix.com/listing.txt , listing.txt
set count=0
for /f "tokens=1,2 delims=-" %%a in (listing.txt) do (
if "%%a" == "runtime/mendix" (
set /a count+=1
set var[!count!]=%%b
)
)
echo.
echo 请选择一个你想要安装的Studio Pro版本号?
echo [162] 9.9.2.35886
echo 例如你输入162表示安装9.9.2.35886
echo.
for /l %%x in (1,1,!count!) do (
echo [%%x] !var[%%x]:~0,-7!
)
echo.
set /p chose=?
echo.
set folder=!var[%chose%]:~0,-7!
echo 你选择安装 !folder!
@REM end version ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
if not exist ./Dependencies (
mkdir Dependencies
)
@REM adoptiumjdk_11_x64.msi – for versions 9.14.0 and above
@REM adoptopenjdk_11_x64.msi – for versions 9.13.x and below
CALL :ensure_file https://mirrors.tuna.tsinghua.edu.cn/Adoptium/11/jdk/x64/windows/OpenJDK11U-jdk_x64_windows_hotspot_11.0.15_10.msi , ./Dependencies/adoptopenjdk_11_x64.msi
CALL :ensure_file %CDN_BASE_URL%/native-builders/latest.exe , ./Dependencies/mendix_native_mobile_builder.exe
CALL :ensure_file https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe , ./Dependencies/credist2010_x64.exe
CALL :ensure_file https://aka.ms/vs/16/release/vc_redist.x64.exe , ./Dependencies/credist2019_x64.exe
CALL :ensure_file https://download.visualstudio.microsoft.com/download/pr/5681bdf9-0a48-45ac-b7bf-21b7b61657aa/bbdc43bc7bf0d15b97c1a98ae2e82ec0/windowsdesktop-runtime-6.0.5-win-x64.exe , ./Dependencies/windowsdesktop-runtime-6.0.3-win-x64.exe
CALL :ensure_file %CDN_BASE_URL%/modelers/Mendix-%folder%-Setup.exe , ./Mendix-%folder%-Setup.exe
EXIT /B %ERRORLEVEL%
:ensure_file
if not exist %~2 (
echo 下载文件 %~1 到 %~2
powershell -Command "(New-Object Net.WebClient).DownloadFile('%~1', '%~2')"
) else (
echo 已经存在 %~2
)
EXIT /B 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment