From 4aa01a33e3670605778f5053cd828e0433977721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9F=83=E5=8D=9A=E6=8B=89=E9=85=B1?= Date: Fri, 17 Mar 2023 16:38:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E5=85=B1=E4=BA=AB=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=85=AC=E5=BC=80=E5=8F=AA=E8=AF=BB=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\346\235\203\346\223\215\344\275\234.dll" | Bin 121856 -> 121856 bytes .../Program.vb" | 15 +++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git "a/+MATLAB/+internal/net7.0-windows/\346\217\220\346\235\203\346\223\215\344\275\234.dll" "b/+MATLAB/+internal/net7.0-windows/\346\217\220\346\235\203\346\223\215\344\275\234.dll" index 583be5d08140db7f690ffcfec537bbc2d10ca408..d8bf09b43085186138fc58ed8e6ad5b7d2724843 100644 GIT binary patch delta 4082 zcmZu!3vg7`8UD|GoO}0faE?p zFct2iwS}V9xU>%GbhNEAf|jv1bwYhanbvk%r5zlr!(i>$)(0XTmD;Ix3jNO6T}Y4% z=R44RV1iT z0c3Lt(N{8U@y1Lao2}e-N#-uLBi;dT@mzzZkWP=*5#3r!#31WL9R4ktl}Z__$P6e| zzE1VhksKveLS)stQJ}>=_z%T*gCd&3Y%5s?;O-0{Cd_QnXcY5QBF8I)r&|t#S1U#{ zF@k3Wx}ais8=#9OD23_hTyW%3QA1(9;%-)TXUC zzuZi-TIq|W=g8*>UXk?39$VxTD`<3b5gY9jv_d4*gw}y}16nNZmXw)3?;k~b9w+!jo$3wWPRQME$VWCYxK!en|u zmdmTwoe#~908(!>WY-YgVM02?fjo6-rbVmvVdkmJ;aHnSxir_n8}b%|Bj7H8)`e?> zdnHDucVC`azOP(P5$(dHp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Qk8i|Gnq1BPj) zkQibEk?s;F94s=C2mppsKR{f0$)#C=n_ZaIb%}dKc>R z;&SjPeb=%u-Zs^8=vP*OhMNdO;zZJ$Xz8>}wW9R65!DPT#kt1T7Pp(2zeyuh(<#2o zJd8wdR4v_SQK@E9bG9{%PBC^k+nNrWMKiOl1Z*!*RMjNj5!ZnjO7Cz3Cwg@^CmpzA5du=05;i<@kaO!{_CmVj@MpMQoWOy1V2%o|LjQB)h zxD!K~ag9rhi$Yo^9L`1BnbcwwVRe-t5oW}h8Ce*2Za8%~ z5JyN(>bR3SDX?HZsh}#@Z0JB|IZNW%%jQhqgZ2Pds-XJ{7bBMgC@Xhs(6gJn|Ib7X^((IRe{} z;px_RMd;OKKl;aAr)J-Hc*2~|e>Ty2IlVTXYRHn_#ViTm$<*0T7=1su+56tAf;uDn vUrXsZ)|!r$57k1g=?Ud8_cgY+@I!XRQM-cwcT{U^JzBnzpW}3@eB%EB-+EE~ diff --git "a/\346\217\220\346\235\203\346\223\215\344\275\234/Program.vb" "b/\346\217\220\346\235\203\346\223\215\344\275\234/Program.vb" index e66b488..28371ee 100644 --- "a/\346\217\220\346\235\203\346\223\215\344\275\234/Program.vb" +++ "b/\346\217\220\346\235\203\346\223\215\344\275\234/Program.vb" @@ -22,11 +22,21 @@ Module Program Builtin_bug_fix End Enum + Private Sub 公开只读权限(路径 As String) + Dim 文件信息 As New FileInfo(路径) + Dim 访问控制 = 文件信息.GetAccessControl + 访问控制.SetAccessRule(New FileSystemAccessRule("Users", FileSystemRights.Read, AccessControlType.Allow)) + 文件信息.SetAccessControl(访问控制) + End Sub + Private Sub 添加共享路径(新路径 As IEnumerable(Of String)) Dim 共享路径 As String = Path.Combine(Environment.GetEnvironmentVariable("ProgramData"), "MathWorks\PathManager\共享路径.txt") Dim 旧路径 As String = File.ReadAllText(共享路径) 新路径 = 新路径.Except(旧路径.Split(";")) If 新路径.Any Then + For Each 路径 As String In 新路径 + 公开只读权限(路径) + Next File.AppendAllText(共享路径, If(旧路径 = "", "", ";") + String.Join(";", 新路径)) End If End Sub @@ -57,10 +67,7 @@ Module Program Dim MatlabRC As String = Path.Combine(MatlabRoot, "toolbox\local\matlabrc.m") '此处要注意避免重复安装导致重复添加多行 File.WriteAllLines(MatlabRC, (From 行 As String In File.ReadAllLines(MatlabRC) Select 行 Where Not 行.EndsWith("%PathManager")).Append($"path(path,fileread('{ProgramData路径}'));%PathManager")) - Dim 文件信息 As New FileInfo(Path.Combine(MatlabRoot, "toolbox\local\pathdef.m")) - Dim 访问控制 = 文件信息.GetAccessControl - 访问控制.SetAccessRule(New FileSystemAccessRule("Users", FileSystemRights.Read, AccessControlType.Allow)) - 文件信息.SetAccessControl(访问控制) + 公开只读权限(Path.Combine(MatlabRoot, "toolbox\local\pathdef.m")) Case 提权操作.Uninstall_Path_Manager Dim Matlab路径 As String = 读入字符串(参数流) File.Copy(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly.Location), "..\savepath.m"), Path.Combine(Matlab路径, "toolbox\matlab\general\savepath.m"), True)