forked from yuxudong1024/Summit2024-Prework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallMinGW.m
More file actions
21 lines (15 loc) · 748 Bytes
/
Copy pathinstallMinGW.m
File metadata and controls
21 lines (15 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function installMinGW
if ~ispc
return
end
mkdir("c:\mpm");
websave("c:\mpm\mpm.exe", "https://www.mathworks.com/mpm/win64/mpm");
destination = matlabroot;
destinationPath = ['""""', destination, '""""'];
cmd = "powershell Start-Process -Wait -Verb runas -ArgumentList 'install --release=" + matlabRelease().Release + " --destination=" + destinationPath + " --release-status Prerelease --products MATLAB_Support_for_MinGW-w64_C/C++_Compiler' C:\mpm\mpm.exe";
system(cmd);
rmdir("c:\mpm\","s")
envs = string(fileread(fullfile(matlabshared.supportpkg.getSupportPackageRoot,"envVariableList")));
lines = split(envs, newline);
mingwLine = lines(startsWith(lines, "MW_MINGW64_LOC"));
setenv("MW_MINGW64_LOC",extractBetween(mingwLine,"|","|"));