File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Samples/DesktopBridge/Launcher Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1717/* ------------------------------------------------------------------------- */
1818namespace Cube . Psa . DesktopBridge ;
1919
20+ using System ;
2021using System . Diagnostics ;
2122using System . IO ;
2223using Windows . Storage ;
@@ -46,8 +47,11 @@ static void Main()
4647 var dir = ApplicationData . Current . GetPublisherCacheFolder ( "printing" ) ;
4748 if ( dir is null ) return ;
4849
49- var src = Path . Combine ( dir . Path , "source.ps" ) ;
50- if ( ! File . Exists ( src ) ) return ;
50+ var raw = Path . Combine ( dir . Path , "source.ps" ) ;
51+ if ( ! File . Exists ( raw ) ) return ;
52+
53+ var src = Path . Combine ( Path . GetTempPath ( ) , Guid . NewGuid ( ) . ToString ( "N" ) ) ;
54+ File . Move ( raw , src ) ;
5155
5256 try
5357 {
@@ -60,6 +64,10 @@ static void Main()
6064 psi . ArgumentList . Add ( src ) ;
6165 Process . Start ( psi ) ? . WaitForExit ( ) ;
6266 }
63- finally { if ( File . Exists ( src ) ) File . Delete ( src ) ; }
67+ finally
68+ {
69+ if ( File . Exists ( raw ) ) File . Delete ( raw ) ;
70+ if ( File . Exists ( src ) ) File . Delete ( src ) ;
71+ }
6472 }
6573}
You can’t perform that action at this time.
0 commit comments