This repository was archived by the owner on May 19, 2021. It is now read-only.
File tree 2 files changed +26
-4
lines changed
2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,23 @@ bool ScanUnityInstallations()
242
242
}
243
243
} // have unity.exe
244
244
} // have uninstaller.exe
245
+ else // no uninstaller, probably preview builds
246
+ {
247
+ var unityExe = Path . Combine ( directories [ i ] , "Editor" , "Unity.exe" ) ;
248
+ if ( File . Exists ( unityExe ) == true )
249
+ {
250
+ // get full version number from uninstaller
251
+ var unityVersion = Tools . GetFileVersionData ( unityExe ) . Replace ( "Unity" , "" ) . Trim ( ) ;
252
+ if ( unityList . ContainsKey ( unityVersion ) == false )
253
+ {
254
+ unityList . Add ( unityVersion , unityExe ) ;
255
+ var dataFolder = Path . Combine ( directories [ i ] , "Editor" , "Data" ) ;
256
+ DateTime ? installDate = Tools . GetLastModifiedTime ( dataFolder ) ;
257
+ // TODO add platforms: PC|iOS|tvOS|Android|UWP|WebGL|Facebook|XBox|PSVita|PS4
258
+ gridUnityList . Rows . Add ( unityVersion , unityExe , installDate ) ;
259
+ }
260
+ } // have unity.exe
261
+ }
245
262
} // got folders
246
263
} // failed check
247
264
} // all root folders
Original file line number Diff line number Diff line change @@ -183,9 +183,14 @@ public static string GetUnityReleaseURL(string version)
183
183
if ( version . Contains ( "f" ) ) // archived
184
184
{
185
185
version = Regex . Replace ( version , @"f." , "" , RegexOptions . IgnoreCase ) ;
186
- string padding = "" ;
187
- if ( version . Contains ( "2018.2" ) ) padding = "" ;
188
- url = "https://unity3d.com/unity/whats-new/" + padding + version ;
186
+ string padding = "unity-" ;
187
+ string whatsnew = "whats-new" ;
188
+ if ( version . Contains ( "5.6" ) ) padding = "" ;
189
+ if ( version . Contains ( "2017.1" ) ) whatsnew = "whatsnew" ;
190
+ if ( version . Contains ( "2017.4" ) ) padding = "" ;
191
+ if ( version . Contains ( "2018" ) ) padding = "" ;
192
+ if ( version . Contains ( "2019" ) ) padding = "" ;
193
+ url = "https://unity3d.com/unity/" + whatsnew + "/" + padding + version ;
189
194
}
190
195
else
191
196
if ( version . Contains ( "p" ) ) // patch version
@@ -358,9 +363,9 @@ public static string GetProjectVersion(string path)
358
363
/// <returns></returns>
359
364
public static string GetFileVersionData ( string path )
360
365
{
361
- // TODO check if path exists
362
366
FileVersionInfo fvi = FileVersionInfo . GetVersionInfo ( path ) ;
363
367
return fvi . ProductName . Replace ( "(64-bit)" , "" ) . Trim ( ) ;
368
+ //return fvi.FileVersion.Replace("(64-bit)", "").Trim();
364
369
}
365
370
366
371
/// <summary>
You can’t perform that action at this time.
0 commit comments