File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -806,6 +806,13 @@ public static bool IsAdministrator()
806806 return await GetCliWrapOutput ( "/bin/bash" , arg ) ;
807807 }
808808
809+ public static async Task < string ? > SetLinuxChmod ( string ? fileName )
810+ {
811+ if ( fileName . IsNullOrEmpty ( ) ) return null ;
812+ var arg = new List < string > ( ) { "-c" , $ "chmod +x { fileName } " } ;
813+ return await GetCliWrapOutput ( "/bin/bash" , arg ) ;
814+ }
815+
809816 #endregion Platform
810817 }
811818}
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ private async Task UpdateFinished()
182182 {
183183 _updateView ? . Invoke ( EViewAction . DispatcherCheckUpdateFinished , false ) ;
184184 await Task . Delay ( 2000 ) ;
185- UpgradeCore ( ) ;
185+ await UpgradeCore ( ) ;
186186
187187 if ( _lstUpdated . Any ( x => x . CoreType == _v2rayN && x . IsFinished == true ) )
188188 {
@@ -228,7 +228,7 @@ private void UpgradeN()
228228 }
229229 }
230230
231- private void UpgradeCore ( )
231+ private async Task UpgradeCore ( )
232232 {
233233 foreach ( var item in _lstUpdated )
234234 {
@@ -266,6 +266,15 @@ private void UpgradeCore()
266266 FileManager . ZipExtractToFile ( fileName , toPath , _config . guiItem . ignoreGeoUpdateCore ? "geo" : "" ) ;
267267 }
268268
269+ if ( Utils . IsLinux ( ) )
270+ {
271+ var filesList = ( new DirectoryInfo ( toPath ) ) . GetFiles ( ) . Select ( u => u . FullName ) . ToList ( ) ;
272+ foreach ( var file in filesList )
273+ {
274+ await Utils . SetLinuxChmod ( Path . Combine ( toPath , item . CoreType ) ) ;
275+ }
276+ }
277+
269278 UpdateView ( item . CoreType , ResUI . MsgUpdateV2rayCoreSuccessfully ) ;
270279
271280 if ( File . Exists ( fileName ) )
You can’t perform that action at this time.
0 commit comments