File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,15 @@ private void HandleTimerEvent(bool updateLocation)
238238 }
239239
240240 UpdateChecker . TryCheckAuto ( ) ;
241+ // Update access time for extracted DLL files to prevent Storage Sense from deleting them
242+ string tempLibPath = Path . Combine ( Path . GetTempPath ( ) , ".net" , Application . ProductName ) ;
243+ if ( Directory . Exists ( tempLibPath ) )
244+ {
245+ foreach ( string filePath in Directory . EnumerateFiles ( tempLibPath , "*.dll" , SearchOption . AllDirectories ) )
246+ {
247+ File . SetLastAccessTime ( filePath , DateTime . Now ) ;
248+ }
249+ }
241250 }
242251
243252 private void OnBackgroundTimerElapsed ( object sender , EventArgs e )
Original file line number Diff line number Diff line change @@ -53,16 +53,15 @@ protected override void WndProc(ref Message m)
5353 m . Result = new IntPtr ( 1 ) ;
5454 break ;
5555 case WM_ENDSESSION :
56- if ( m . WParam != IntPtr . Zero )
56+ if ( ( m . LParam & ENDSESSION_CLOSEAPP ) != 0 )
5757 {
5858 Application . Exit ( ) ;
5959 }
6060 m . Result = IntPtr . Zero ;
6161 break ;
62- default :
63- base . WndProc ( ref m ) ;
64- break ;
6562 }
63+
64+ base . WndProc ( ref m ) ;
6665 }
6766
6867 private void HiddenForm_Load ( object source , EventArgs e )
You can’t perform that action at this time.
0 commit comments