diff --git a/build-godot.sh b/build-godot.sh index 1f8ffef..d2252a0 100755 --- a/build-godot.sh +++ b/build-godot.sh @@ -92,7 +92,7 @@ pushd godot ln -f -s ../custom.py . # Clean Prior Builds. -#scons --clean +scons --clean # Build Editor. scons platform=linuxbsd target=editor arch=x86_64 ${LTO} @@ -101,7 +101,9 @@ scons platform=linuxbsd target=editor arch=x86_64 ${LTO} scons compiledb=yes # Build Templates. +scons platform=linuxbsd target=template_debug arch=x86_64 ${TEMPLATE} ${LTO} scons platform=linuxbsd target=template_release arch=x86_64 ${TEMPLATE} ${LTO} +scons platform=windows target=template_debug arch=x86_64 ${TEMPLATE} ${LTO} scons platform=windows target=template_release arch=x86_64 ${TEMPLATE} ${LTO} popd diff --git a/hamncheese/Scripts/edge.gd b/hamncheese/Scripts/edge.gd index 199d689..2241ef0 100644 --- a/hamncheese/Scripts/edge.gd +++ b/hamncheese/Scripts/edge.gd @@ -91,8 +91,15 @@ func _send(what: String, mode: String = MODE_READ): func start_edge(community: String, key: String, supernode: String, port: int = 7777, my_port: int = 5643, management_port: int = 5644): - _password = Util.generate_password() - _edge_pid = await Process.elevate(OS.get_user_data_dir() + "/edge", ["--management-password", _password, "-c", community, "-k", key, "-l", supernode + ":" + str(port), "-f"]) + var binary = OS.get_user_data_dir() + "/edge" + var arguments = ["--management-password", _password, "-c", community, "-k", key, "-l", supernode + ":" + str(port)] + if OS.get_name() == "Windows": + binary = binary + ".exe" + _edge_pid = OS.create_process(binary, arguments, false) + else: + arguments.append("-f") + _password = Util.generate_password() + _edge_pid = await Process.elevate(binary, arguments) if _edge_pid < 0: await Dialog.alert("Error", "Unable to start network layer!") return false diff --git a/hamncheese/Scripts/process.gd b/hamncheese/Scripts/process.gd index bdd5af3..ac0397f 100644 --- a/hamncheese/Scripts/process.gd +++ b/hamncheese/Scripts/process.gd @@ -43,8 +43,11 @@ func _elevate_unix(program: String, arguments: PackedStringArray): return pid -func _elevate_windows(_program: String, _arguments: PackedStringArray): - pass +func _elevate_windows(program: String, arguments: PackedStringArray): + # powershell.exe -Command Start-Process edge.exe -ArgumentList 'stuff here' -Verb runAs + var options = ["-Command", "Start-Process", program, "-ArgumentList", "'" + " ".join(arguments) + "'", "-Verb", "runAs"] + var pid = OS.create_process("powershell.exe", options, true) + return pid func _process(_delta): diff --git a/hamncheese/project.godot b/hamncheese/project.godot index 4f10fdb..ed0d96d 100644 --- a/hamncheese/project.godot +++ b/hamncheese/project.godot @@ -13,6 +13,8 @@ config_version=5 config/name="Ham'n'Cheese" config/description="Open Source Peer-to-Peer VPN Client" run/main_scene="res://Scenes/main.tscn" +config/use_custom_user_dir=true +config/custom_user_dir_name="Kangaroo Punch/HamNCheese" config/auto_accept_quit=false config/features=PackedStringArray("4.2", "GL Compatibility") run/low_processor_mode=true