You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let config = curr_path.with_extension("runtimeconfig.json");
29
+
let pdb_file = curr_path.with_file_name("{pdb_file}");
30
+
letmut requires_refresh = false;
31
+
if dll_path.exists(){{
32
+
let ondisk_len = std::fs::File::open(dll_path.clone()).expect("Could not create a file to unpack the .NET assembly").metadata().unwrap().len();
33
+
// If the length on disk is != expected, write the new file TODO: this can very rarely not detect if an update is needed. Check assembly GUID too, to ensure recompilation works.
34
+
if ondisk_len != DOTNET_ASSEMBLY.len()asu64{{
35
+
requires_refresh = true;
36
+
}}
37
+
}}
38
+
if !dll_path.exists() || requires_refresh {{
39
+
letmut file = std::fs::File::create(dll_path.clone()).expect("Could not create a file to unpack the .NET assembly");
40
+
file.write_all(DOTNET_ASSEMBLY).expect("Could not unpack the .NET assembly");
41
+
}}
42
+
if !config.exists() ||requires_refresh {{
43
+
letmut file = std::fs::File::create(config).expect("Could not create a file to save .NET runtime settings.");
44
+
file.write_all(RUNTIME_COFIG).expect("Could not save .NET runtime settings");
45
+
}}
46
+
if{has_native_companion}{{
47
+
if !std::path::Path::new("{native_companion_file}").exists() || requires_refresh{{
48
+
letmut file = std::fs::File::create("{native_companion_file}").expect("Could not create a file to provide the native companion.");
49
+
file.write_all(BUNDLED_SHARED_LIB).expect("Could create a file to provide the native companion");
50
+
}}
51
+
52
+
}}
53
+
if{has_pdb}{{
54
+
if !pdb_file.exists() || requires_refresh{{
55
+
println!("creating the pdb file");
56
+
letmut file = std::fs::File::create(pdb_file).expect("Could not create a file to provide the pdb debug info.");
57
+
file.write_all(BUNDLED_PDB).expect("Could create a file to provide the pdb debug info.");
58
+
}}
59
+
else{{
60
+
println!("Not creating the pdb file");
61
+
}}
62
+
}}
63
+
let args:Vec<String> = std::env::args().collect();
64
+
let args = &args[1..];
65
+
std::process::Command::new("{jumpstart_cmd}").arg(dll_path).args(args).status().expect("Could not start the .NET runtime.");
let config = curr_path.with_extension("runtimeconfig.json");
26
-
let pdb_file = curr_path.with_file_name("{pdb_file}");
27
-
letmut requires_refresh = false;
28
-
if dll_path.exists(){
29
-
{
30
-
let ondisk_len = std::fs::File::open(dll_path.clone())
31
-
.expect("Could not create a file to unpack the .NET assembly")
32
-
.metadata()
33
-
.unwrap()
34
-
.len();
35
-
// If the length on disk is != expected, write the new file TODO: this can very rarely not detect if an update is needed. Check assembly GUID too, to ensure recompilation works.
0 commit comments