@@ -580,35 +580,19 @@ public static void DownloadAndInstall(string url, string version)
580
580
// TODO make async
581
581
if ( DownloadFile ( exeURL , tempFile ) == true )
582
582
{
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 ; ;
604
586
605
- Process process ;
606
587
// if user clicks NO to UAC, this fails (so added try-catch)
607
588
try
608
589
{
609
- process = Process . Start ( tempFile ) ;
590
+ Process process = new Process ( ) ;
591
+ process . StartInfo . FileName = tempFile ;
592
+ process . StartInfo . Arguments = targetPathArgs ;
610
593
process . EnableRaisingEvents = true ;
611
594
process . Exited += ( sender , e ) => DeleteTempFile ( tempFile ) ;
595
+ process . Start ( ) ;
612
596
}
613
597
catch ( Exception )
614
598
{
0 commit comments