File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ void CreateProjectDialogD::OnCreate(wxCommandEvent& event){
71
71
// assemble the command that will create the project described by the dialog
72
72
73
73
editor& e = editors[GetSelectedEditorIndex ()];
74
- auto executablePath = e.path / e. name / executable ;
75
- auto executableTemplatesPath = e.path / e. name / templatesDir ;
74
+ auto executablePath = e.executablePath () ;
75
+ auto executableTemplatesPath = e.templatePath () ;
76
76
string projName = projNameTxt->GetValue ().ToStdString ();
77
77
string projPath = projLocTxt->GetValue ().ToStdString ();
78
78
Original file line number Diff line number Diff line change @@ -29,11 +29,11 @@ struct wxWindow;
29
29
static constexpr std::string_view installerExt = " dmg" ;
30
30
31
31
// where to find various Unity things on macOS
32
- static const std::filesystem::path executable = " Unity.app/ Contents/MacOS/Unity" ;
32
+ static const std::filesystem::path executable = " Contents/MacOS/Unity" ;
33
33
static const std::vector<std::filesystem::path> defaultInstall = {" /Applications/Unity/Hub/Editor" ," /Applications/Unity/" };
34
34
// TODO: make this a preference?
35
35
static const std::filesystem::path hubDefault = " /Applications/Unity Hub.app" ;
36
- static const std::filesystem::path templatesDir = " Unity.app/ Contents/Resources/PackageManager/ProjectTemplates/" ;
36
+ static const std::filesystem::path templatesDir = " Contents/Resources/PackageManager/ProjectTemplates/" ;
37
37
38
38
// for stream redirecting to dev/null
39
39
static constexpr std::string_view null_device = " >/dev/null 2>&1" ;
@@ -123,6 +123,10 @@ struct editor {
123
123
return path / name / executable;
124
124
#endif
125
125
}
126
+
127
+ auto templatePath () const {
128
+ return path / templatesDir;
129
+ }
126
130
127
131
bool operator ==(const editor& other) {
128
132
return this ->name == other.name ; // many editors can share a root path
Original file line number Diff line number Diff line change @@ -618,13 +618,19 @@ void MainFrameDerived::LoadEditorVersions(){
618
618
// unity versions at once, which sucks. To get the version,
619
619
// we need to parse the info.plist inside of Unity.app
620
620
auto infopath = entry / " Unity.app" / " Contents" / " Info.plist" ;
621
- if (filesystem::exists (infopath)){
621
+ auto basedir = entry / " Unity.app" ;
622
+ if (!filesystem::exists (infopath)){
623
+ // maybe this was a direct install
624
+ infopath = entry / " Contents" / " Info.plist" ;
625
+ basedir = entry;
626
+ }
627
+ if (filesystem::exists (infopath) && infopath.string ().find (" Unity.app" ) != std::string::npos){
622
628
// read the file and look for CFBundleVersion
623
629
char buffer[16 ]{0 };
624
630
getCFBundleVersionFromPlist (infopath.string ().c_str (), buffer, sizeof (buffer));
625
631
626
632
// add it to the backing datastructure
627
- editor e = {buffer, entry };
633
+ editor e = {buffer, basedir };
628
634
addInstall (e);
629
635
}
630
636
#else
You can’t perform that action at this time.
0 commit comments