@@ -580,35 +580,19 @@ public static void DownloadAndInstall(string url, string version)
580580 // TODO make async
581581 if ( DownloadFile ( exeURL , tempFile ) == true )
582582 {
583- // run installer, copy current existing version path to clipboard, NOTE this probably never happens? unless install same version again..
584- if ( MainWindow . unityInstalledVersions . ContainsKey ( version ) == true )
585- {
586- string path = MainWindow . unityInstalledVersions [ version ] ;
587- if ( string . IsNullOrEmpty ( path ) == false )
588- {
589- // copy to clipboard
590- Clipboard . SetText ( path ) ;
591- }
592- }
593- else // no same version, copy last item from root folders
594- {
595- if ( Properties . Settings . Default . rootFolders . Count > 0 )
596- {
597- string path = Properties . Settings . Default . rootFolders [ Properties . Settings . Default . rootFolders . Count - 1 ] ;
598- if ( string . IsNullOrEmpty ( path ) == false )
599- {
600- Clipboard . SetText ( path ) ;
601- }
602- }
603- }
583+ // get base version, to use for install path
584+ string outputVersionFolder = "\\ " + version . Split ( '.' ) [ 0 ] + "_" + version . Split ( '.' ) [ 1 ] ;
585+ string targetPathArgs = " /D=" + Properties . Settings . Default . rootFolders [ Properties . Settings . Default . rootFolders . Count - 1 ] + outputVersionFolder ; ;
604586
605- Process process ;
606587 // if user clicks NO to UAC, this fails (so added try-catch)
607588 try
608589 {
609- process = Process . Start ( tempFile ) ;
590+ Process process = new Process ( ) ;
591+ process . StartInfo . FileName = tempFile ;
592+ process . StartInfo . Arguments = targetPathArgs ;
610593 process . EnableRaisingEvents = true ;
611594 process . Exited += ( sender , e ) => DeleteTempFile ( tempFile ) ;
595+ process . Start ( ) ;
612596 }
613597 catch ( Exception )
614598 {
0 commit comments