@@ -829,7 +829,8 @@ public static string ParseDownloadURLFromWebpage(string version, bool preferFull
829
829
else
830
830
{
831
831
// TODO version here is actually HASH
832
- url = $ "https://beta.unity3d.com/download/{ version } /download.html";
832
+ string hash = version ;
833
+ url = $ "https://beta.unity3d.com/download/{ hash } /download.html";
833
834
834
835
//Console.WriteLine(url);
835
836
@@ -838,7 +839,7 @@ public static string ParseDownloadURLFromWebpage(string version, bool preferFull
838
839
//Console.WriteLine(version);
839
840
if ( string . IsNullOrEmpty ( version ) )
840
841
{
841
- Console . WriteLine ( "Failed to get version number from hash: " + version ) ;
842
+ SetStatus ( "Failed to get version (" + version + ") number from hash: " + hash ) ;
842
843
return null ;
843
844
}
844
845
}
@@ -2218,6 +2219,40 @@ internal static void SaveProjectSettings(Project proj, string customEnvVars)
2218
2219
Console . WriteLine ( fullPath ) ;
2219
2220
}
2220
2221
}
2222
+
2223
+ internal static void OpenCustomAssetPath ( )
2224
+ {
2225
+ // check if custom asset folder is used, then open both *since older versions might have assets in old folder
2226
+ string keyPath = @"SOFTWARE\Unity Technologies\Unity Editor 5.x" ;
2227
+ using ( RegistryKey key = Registry . CurrentUser . OpenSubKey ( keyPath ) )
2228
+ {
2229
+ if ( key == null ) return ;
2230
+ // Enumerate subkeys
2231
+ foreach ( string valueName in key . GetValueNames ( ) )
2232
+ {
2233
+ // Check if the subkey matches the desired pattern
2234
+ if ( Regex . IsMatch ( valueName , @"AssetStoreCacheRootPath_h\d+" ) == false ) continue ;
2235
+
2236
+ string customAssetPath = "" ;
2237
+ var valueKind = key . GetValueKind ( valueName ) ;
2238
+
2239
+ if ( valueKind == RegistryValueKind . Binary )
2240
+ {
2241
+ byte [ ] bytes = ( byte [ ] ) key . GetValue ( valueName ) ;
2242
+ customAssetPath = Encoding . UTF8 . GetString ( bytes , 0 , bytes . Length - 1 ) ;
2243
+ }
2244
+ else // should be string then
2245
+ {
2246
+ customAssetPath = ( string ) key . GetValue ( valueName ) ;
2247
+ }
2248
+
2249
+ if ( string . IsNullOrEmpty ( customAssetPath ) == false && Directory . Exists ( customAssetPath ) )
2250
+ {
2251
+ Tools . LaunchExplorer ( Path . Combine ( customAssetPath , "Asset Store-5.x" ) ) ;
2252
+ }
2253
+ }
2254
+ }
2255
+ }
2221
2256
} // class
2222
2257
2223
2258
} // namespace
0 commit comments