@@ -395,23 +395,6 @@ void MainFrameDerived::OpenProject(const long& index){
395
395
return ;
396
396
}
397
397
}
398
- #if __APPLE__
399
- for (const auto & path : installPaths) {
400
- if (filesystem::exists (path / executable)) {
401
- // mac unlabeled version
402
- auto unlabeledPath = path / executable;
403
- char buffer[16 ];
404
- auto unlabeledPathInfo = path / " Unity.app" / " Contents" / " Info.plist" ;
405
- getCFBundleVersionFromPlist (unlabeledPathInfo.string ().c_str (), buffer, sizeof (buffer));
406
- if (p.version == buffer) {
407
- string cmd = " \" " + unlabeledPath.string () + " \" -projectpath \" " + p.path .string () + " \" " ;
408
- launch_process (cmd);
409
- return ;
410
- }
411
- }
412
- }
413
- #endif
414
-
415
398
416
399
// prompt the user to choose a new editor because we couldn't locate one
417
400
wxCommandEvent evt;
@@ -445,7 +428,7 @@ const char* const PlatToStr(TargetPlatform plat) {
445
428
@param e the editor version to use when opening the project
446
429
*/
447
430
void MainFrameDerived::OpenProject (const project& p, const editor& e, TargetPlatform plat){
448
- string cmd = " \" " + (e. path / e. name / executable ).string () + " \" -projectpath \" " + p.path .string () + " \" " ;
431
+ string cmd = " \" " + e. executablePath ( ).string () + " \" -projectpath \" " + p.path .string () + " \" " ;
449
432
if (plat != TargetPlatform::CurrentPlatform) {
450
433
auto str = PlatToStr (plat);
451
434
cmd += fmt::format (" -buildTarget {}" , str);
@@ -595,8 +578,6 @@ void MainFrameDerived::LoadEditorVersions(){
595
578
wxCommandEvent e;
596
579
OnSelectEditor (e);
597
580
editors.clear ();
598
-
599
-
600
581
601
582
// iterate over the search paths
602
583
for (auto & path : installPaths){
@@ -630,38 +611,35 @@ void MainFrameDerived::LoadEditorVersions(){
630
611
// is this a folder?
631
612
if (dir_entry.is_directory ()){
632
613
// does this folder have a valid executable inside?
633
- auto p = path / entry.filename () / executable;
634
- if (filesystem::exists (p)){
635
- // add it to the list
614
+
615
+ // add it to the list
636
616
#if __APPLE__
637
- // the Unity Download Assistant on Mac does not allow multiple
638
- // unity versions at once, which sucks. To get the version,
639
- // we need to parse the info.plist inside of Unity.app
640
- auto pathstr = entry.filename ().string ();
641
- if (pathstr == " ." ){
642
- auto infopath = path / entry.filename () / " Unity.app" / " Contents" / " Info.plist" ;
643
- if (filesystem::exists (infopath)){
644
- // read the file and look for CFBundleVersion
645
- char buffer[16 ]{0 };
646
- getCFBundleVersionFromPlist (infopath.string ().c_str (), buffer, sizeof (buffer));
647
-
648
- // add it to the backing datastructure
649
- editor e = {buffer, path};
650
- addInstall (e);
651
- }
652
- }
653
- else
654
- #endif
655
- {
656
- // add it to the backing datastructure
657
- editor e = {entry.filename (), path};
658
- addInstall (e);
659
- }
617
+ // the Unity Download Assistant on Mac does not allow multiple
618
+ // unity versions at once, which sucks. To get the version,
619
+ // we need to parse the info.plist inside of Unity.app
620
+ auto infopath = entry / " Unity.app" / " Contents" / " Info.plist" ;
621
+ if (filesystem::exists (infopath)){
622
+ // read the file and look for CFBundleVersion
623
+ char buffer[16 ]{0 };
624
+ getCFBundleVersionFromPlist (infopath.string ().c_str (), buffer, sizeof (buffer));
625
+
626
+ // add it to the backing datastructure
627
+ editor e = {buffer, entry};
628
+ addInstall (e);
660
629
}
630
+ #else
631
+ auto p = entry / executable;
632
+ if (filesystem::exists (p)){
633
+ // add it to the backing datastructure
634
+ editor e = {entry.filename (), p};
635
+ addInstall (e);
636
+ }
637
+ #endif
661
638
}
662
639
663
640
installsList->Append (a);
664
641
}
642
+
665
643
}
666
644
}
667
645
0 commit comments