@@ -58,6 +58,7 @@ public static void Init(string[] args)
5858 }
5959
6060 #region DESKTOP_SHORTCUT
61+ #if ! FOR_MICROSOFT_STORE_ONLY
6162 if ( _args . Contains ( DESKTOP_SHORTCUT_INSTALL ) )
6263 {
6364 InstallDesktopShortcut ( true ) ;
@@ -66,6 +67,7 @@ public static void Init(string[] args)
6667 {
6768 InstallDesktopShortcut ( false ) ;
6869 }
70+ #endif
6971 if ( _args . Contains ( DESKTOP_SHORTCUT_INSTALL ) ) _args . Remove ( DESKTOP_SHORTCUT_INSTALL ) ;
7072 if ( _args . Contains ( DESKTOP_SHORTCUT_UNINSTALL ) ) _args . Remove ( DESKTOP_SHORTCUT_UNINSTALL ) ;
7173 #endregion
@@ -128,7 +130,7 @@ public static void ProcessWhenDataLoaded()
128130 NamedPipeHelper . OnMessageReceived += message =>
129131 {
130132 SimpleLogHelper . Debug ( "NamedPipeServerStream get: " + message ) ;
131- var strings = new HashSet < string > ( message . Split ( new [ ] { Separator } , StringSplitOptions . RemoveEmptyEntries ) . Distinct ( ) ) ;
133+ var strings = new HashSet < string > ( message . Split ( new [ ] { Separator } , StringSplitOptions . RemoveEmptyEntries ) . Distinct ( ) ) ;
132134 ProcessArg ( strings ) ;
133135 } ;
134136 }
@@ -163,9 +165,9 @@ private static void ProcessArg(ICollection<string> args)
163165 }
164166 }
165167 }
166- else if ( arg . StartsWith ( "id :" , StringComparison . OrdinalIgnoreCase ) )
168+ else if ( arg . StartsWith ( "ULID :" , StringComparison . OrdinalIgnoreCase ) )
167169 {
168- var id = arg . Substring ( 3 ) ;
170+ var id = arg . Substring ( "ULID:" . Length ) . Trim ( ) ;
169171 var server = IoC . Get < GlobalData > ( ) . VmItemList . FirstOrDefault ( x => string . Equals ( x . Id , id , StringComparison . CurrentCultureIgnoreCase ) ) ;
170172 if ( server != null && servers . Contains ( server . Server ) == false )
171173 {
@@ -199,12 +201,12 @@ private static void InstallDesktopShortcut(bool isInstall)
199201 {
200202 var desktopPath = Environment . GetFolderPath ( Environment . SpecialFolder . DesktopDirectory ) ;
201203 var shortcutPath = System . IO . Path . Combine ( desktopPath , Assert . APP_DISPLAY_NAME + ".lnk" ) ;
204+ if ( System . IO . File . Exists ( shortcutPath ) )
205+ {
206+ System . IO . File . Delete ( shortcutPath ) ;
207+ }
202208 if ( isInstall )
203209 {
204- if ( System . IO . File . Exists ( shortcutPath ) )
205- {
206- System . IO . File . Delete ( shortcutPath ) ;
207- }
208210 var shortcut = new IWshRuntimeLibrary . WshShell ( ) . CreateShortcut ( shortcutPath ) ;
209211 shortcut . IconLocation =
210212 shortcut . TargetPath = Process . GetCurrentProcess ( ) . MainModule ! . FileName ! ;
@@ -213,13 +215,6 @@ private static void InstallDesktopShortcut(bool isInstall)
213215 shortcut . Description = Assert . APP_DISPLAY_NAME ;
214216 shortcut . Save ( ) ;
215217 }
216- else
217- {
218- if ( System . IO . File . Exists ( shortcutPath ) )
219- {
220- System . IO . File . Delete ( shortcutPath ) ;
221- }
222- }
223218 }
224219#endif
225220
0 commit comments