export_plugin.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. /**************************************************************************/
  2. /* export_plugin.cpp */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #include "export_plugin.h"
  31. #include "logo_svg.gen.h"
  32. #include "editor/editor_scale.h"
  33. #include "editor/editor_settings.h"
  34. #include "scene/resources/image_texture.h"
  35. #include "modules/modules_enabled.gen.h" // For svg and regex.
  36. #ifdef MODULE_SVG_ENABLED
  37. #include "modules/svg/image_loader_svg.h"
  38. #endif
  39. String EditorExportPlatformUWP::get_name() const {
  40. return "UWP";
  41. }
  42. String EditorExportPlatformUWP::get_os_name() const {
  43. return "UWP";
  44. }
  45. List<String> EditorExportPlatformUWP::get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const {
  46. List<String> list;
  47. list.push_back("appx");
  48. return list;
  49. }
  50. Ref<Texture2D> EditorExportPlatformUWP::get_logo() const {
  51. return logo;
  52. }
  53. void EditorExportPlatformUWP::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const {
  54. r_features->push_back("s3tc");
  55. r_features->push_back("etc");
  56. r_features->push_back(p_preset->get("binary_format/architecture"));
  57. }
  58. void EditorExportPlatformUWP::get_export_options(List<ExportOption> *r_options) const {
  59. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/debug", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), ""));
  60. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), ""));
  61. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "binary_format/architecture", PROPERTY_HINT_ENUM, "x86_64,x86_32,arm32"), "x86_64"));
  62. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "command_line/extra_args"), ""));
  63. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/display_name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Game Name"), ""));
  64. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/short_name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Game Name"), ""));
  65. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/unique_name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Game.Name"), ""));
  66. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/description"), ""));
  67. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/publisher", PROPERTY_HINT_PLACEHOLDER_TEXT, "CN=CompanyName"), ""));
  68. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/publisher_display_name", PROPERTY_HINT_PLACEHOLDER_TEXT, "Company Name"), ""));
  69. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "identity/product_guid", PROPERTY_HINT_PLACEHOLDER_TEXT, "00000000-0000-0000-0000-000000000000"), ""));
  70. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "identity/publisher_guid", PROPERTY_HINT_PLACEHOLDER_TEXT, "00000000-0000-0000-0000-000000000000"), ""));
  71. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "signing/certificate", PROPERTY_HINT_GLOBAL_FILE, "*.pfx", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SECRET), ""));
  72. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "signing/password", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SECRET), ""));
  73. r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "signing/algorithm", PROPERTY_HINT_ENUM, "MD5,SHA1,SHA256"), 2));
  74. r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/major"), 1));
  75. r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/minor"), 0));
  76. r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/build"), 0));
  77. r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/revision"), 0));
  78. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/landscape"), true));
  79. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/portrait"), true));
  80. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/landscape_flipped"), true));
  81. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/portrait_flipped"), true));
  82. r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "images/background_color"), "transparent"));
  83. r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/store_logo", PROPERTY_HINT_RESOURCE_TYPE, "CompressedTexture2D"), Variant()));
  84. r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square44x44_logo", PROPERTY_HINT_RESOURCE_TYPE, "CompressedTexture2D"), Variant()));
  85. r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square71x71_logo", PROPERTY_HINT_RESOURCE_TYPE, "CompressedTexture2D"), Variant()));
  86. r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square150x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "CompressedTexture2D"), Variant()));
  87. r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square310x310_logo", PROPERTY_HINT_RESOURCE_TYPE, "CompressedTexture2D"), Variant()));
  88. r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/wide310x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "CompressedTexture2D"), Variant()));
  89. r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/splash_screen", PROPERTY_HINT_RESOURCE_TYPE, "CompressedTexture2D"), Variant()));
  90. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square150x150"), false));
  91. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "tiles/show_name_on_wide310x150"), false));
  92. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square310x310"), false));
  93. // Capabilities
  94. const char **basic = uwp_capabilities;
  95. while (*basic) {
  96. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*basic)), false));
  97. basic++;
  98. }
  99. const char **uap = uwp_uap_capabilities;
  100. while (*uap) {
  101. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*uap)), false));
  102. uap++;
  103. }
  104. const char **device = uwp_device_capabilities;
  105. while (*device) {
  106. r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*device)), false));
  107. device++;
  108. }
  109. }
  110. bool EditorExportPlatformUWP::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const {
  111. #ifndef DEV_ENABLED
  112. // We don't provide export templates for the UWP platform currently as it
  113. // has not been ported for Godot 4. This is skipped in DEV_ENABLED so that
  114. // contributors can still test the pipeline if/when we can build it again.
  115. r_error = "The UWP platform is currently not supported in Godot 4.\n";
  116. return false;
  117. #endif
  118. String err;
  119. bool valid = false;
  120. // Look for export templates (first official, and if defined custom templates).
  121. String arch = p_preset->get("binary_format/architecture");
  122. String arch_infix;
  123. if (arch == "arm32") {
  124. arch_infix = "arm";
  125. } else if (arch == "x86_32") {
  126. arch_infix = "x86";
  127. } else if (arch == "x86_64") {
  128. arch_infix = "x64";
  129. }
  130. bool dvalid = exists_export_template("uwp_" + arch_infix + "_debug.zip", &err);
  131. bool rvalid = exists_export_template("uwp_" + arch_infix + "_release.zip", &err);
  132. if (p_preset->get("custom_template/debug") != "") {
  133. dvalid = FileAccess::exists(p_preset->get("custom_template/debug"));
  134. if (!dvalid) {
  135. err += TTR("Custom debug template not found.") + "\n";
  136. }
  137. }
  138. if (p_preset->get("custom_template/release") != "") {
  139. rvalid = FileAccess::exists(p_preset->get("custom_template/release"));
  140. if (!rvalid) {
  141. err += TTR("Custom release template not found.") + "\n";
  142. }
  143. }
  144. valid = dvalid || rvalid;
  145. r_missing_templates = !valid;
  146. if (!err.is_empty()) {
  147. r_error = err;
  148. }
  149. return valid;
  150. }
  151. bool EditorExportPlatformUWP::has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
  152. #ifndef DEV_ENABLED
  153. // We don't provide export templates for the UWP platform currently as it
  154. // has not been ported for Godot 4. This is skipped in DEV_ENABLED so that
  155. // contributors can still test the pipeline if/when we can build it again.
  156. r_error = "The UWP platform is currently not supported in Godot 4.\n";
  157. return false;
  158. #endif
  159. String err;
  160. bool valid = true;
  161. // Validate the project configuration.
  162. if (!_valid_resource_name(p_preset->get("package/short_name"))) {
  163. valid = false;
  164. err += TTR("Invalid package short name.") + "\n";
  165. }
  166. if (!_valid_resource_name(p_preset->get("package/unique_name"))) {
  167. valid = false;
  168. err += TTR("Invalid package unique name.") + "\n";
  169. }
  170. if (!_valid_resource_name(p_preset->get("package/publisher_display_name"))) {
  171. valid = false;
  172. err += TTR("Invalid package publisher display name.") + "\n";
  173. }
  174. if (!_valid_guid(p_preset->get("identity/product_guid"))) {
  175. valid = false;
  176. err += TTR("Invalid product GUID.") + "\n";
  177. }
  178. if (!_valid_guid(p_preset->get("identity/publisher_guid"))) {
  179. valid = false;
  180. err += TTR("Invalid publisher GUID.") + "\n";
  181. }
  182. if (!_valid_bgcolor(p_preset->get("images/background_color"))) {
  183. valid = false;
  184. err += TTR("Invalid background color.") + "\n";
  185. }
  186. if (!p_preset->get("images/store_logo").is_zero() && !_valid_image((Object::cast_to<CompressedTexture2D>((Object *)p_preset->get("images/store_logo"))), 50, 50)) {
  187. valid = false;
  188. err += TTR("Invalid Store Logo image dimensions (should be 50x50).") + "\n";
  189. }
  190. if (!p_preset->get("images/square44x44_logo").is_zero() && !_valid_image((Object::cast_to<CompressedTexture2D>((Object *)p_preset->get("images/square44x44_logo"))), 44, 44)) {
  191. valid = false;
  192. err += TTR("Invalid square 44x44 logo image dimensions (should be 44x44).") + "\n";
  193. }
  194. if (!p_preset->get("images/square71x71_logo").is_zero() && !_valid_image((Object::cast_to<CompressedTexture2D>((Object *)p_preset->get("images/square71x71_logo"))), 71, 71)) {
  195. valid = false;
  196. err += TTR("Invalid square 71x71 logo image dimensions (should be 71x71).") + "\n";
  197. }
  198. if (!p_preset->get("images/square150x150_logo").is_zero() && !_valid_image((Object::cast_to<CompressedTexture2D>((Object *)p_preset->get("images/square150x150_logo"))), 150, 150)) {
  199. valid = false;
  200. err += TTR("Invalid square 150x150 logo image dimensions (should be 150x150).") + "\n";
  201. }
  202. if (!p_preset->get("images/square310x310_logo").is_zero() && !_valid_image((Object::cast_to<CompressedTexture2D>((Object *)p_preset->get("images/square310x310_logo"))), 310, 310)) {
  203. valid = false;
  204. err += TTR("Invalid square 310x310 logo image dimensions (should be 310x310).") + "\n";
  205. }
  206. if (!p_preset->get("images/wide310x150_logo").is_zero() && !_valid_image((Object::cast_to<CompressedTexture2D>((Object *)p_preset->get("images/wide310x150_logo"))), 310, 150)) {
  207. valid = false;
  208. err += TTR("Invalid wide 310x150 logo image dimensions (should be 310x150).") + "\n";
  209. }
  210. if (!p_preset->get("images/splash_screen").is_zero() && !_valid_image((Object::cast_to<CompressedTexture2D>((Object *)p_preset->get("images/splash_screen"))), 620, 300)) {
  211. valid = false;
  212. err += TTR("Invalid splash screen image dimensions (should be 620x300).") + "\n";
  213. }
  214. r_error = err;
  215. return valid;
  216. }
  217. Error EditorExportPlatformUWP::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
  218. ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags);
  219. String src_appx;
  220. EditorProgress ep("export", "Exporting for UWP", 7, true);
  221. if (p_debug) {
  222. src_appx = p_preset->get("custom_template/debug");
  223. } else {
  224. src_appx = p_preset->get("custom_template/release");
  225. }
  226. src_appx = src_appx.strip_edges();
  227. String arch = p_preset->get("binary_format/architecture");
  228. if (src_appx.is_empty()) {
  229. String err, arch_infix;
  230. if (arch == "arm32") {
  231. arch_infix = "arm";
  232. } else if (arch == "x86_32") {
  233. arch_infix = "x86";
  234. } else if (arch == "x86_64") {
  235. arch_infix = "x64";
  236. }
  237. if (p_debug) {
  238. src_appx = find_export_template("uwp_" + arch_infix + "_debug.zip", &err);
  239. } else {
  240. src_appx = find_export_template("uwp_" + arch_infix + "_release.zip", &err);
  241. }
  242. if (src_appx.is_empty()) {
  243. EditorNode::add_io_error(err);
  244. return ERR_FILE_NOT_FOUND;
  245. }
  246. }
  247. if (!DirAccess::exists(p_path.get_base_dir())) {
  248. return ERR_FILE_BAD_PATH;
  249. }
  250. Error err = OK;
  251. Ref<FileAccess> fa_pack = FileAccess::open(p_path, FileAccess::WRITE, &err);
  252. ERR_FAIL_COND_V_MSG(err != OK, ERR_CANT_CREATE, "Cannot create file '" + p_path + "'.");
  253. AppxPackager packager;
  254. packager.init(fa_pack);
  255. Ref<FileAccess> io_fa;
  256. zlib_filefunc_def io = zipio_create_io(&io_fa);
  257. if (ep.step("Creating package...", 0)) {
  258. return ERR_SKIP;
  259. }
  260. unzFile pkg = unzOpen2(src_appx.utf8().get_data(), &io);
  261. if (!pkg) {
  262. EditorNode::add_io_error("Could not find template appx to export:\n" + src_appx);
  263. return ERR_FILE_NOT_FOUND;
  264. }
  265. int ret = unzGoToFirstFile(pkg);
  266. if (ep.step("Copying template files...", 1)) {
  267. return ERR_SKIP;
  268. }
  269. EditorNode::progress_add_task("template_files", "Template files", 100);
  270. packager.set_progress_task("template_files");
  271. int template_files_amount = 9;
  272. int template_file_no = 1;
  273. while (ret == UNZ_OK) {
  274. // get file name
  275. unz_file_info info;
  276. char fname[16834];
  277. ret = unzGetCurrentFileInfo(pkg, &info, fname, 16834, nullptr, 0, nullptr, 0);
  278. if (ret != UNZ_OK) {
  279. break;
  280. }
  281. String path = String::utf8(fname);
  282. if (path.ends_with("/")) {
  283. // Ignore directories
  284. ret = unzGoToNextFile(pkg);
  285. continue;
  286. }
  287. Vector<uint8_t> data;
  288. bool do_read = true;
  289. if (path.begins_with("Assets/")) {
  290. path = path.replace(".scale-100", "");
  291. data = _get_image_data(p_preset, path);
  292. if (data.size() > 0) {
  293. do_read = false;
  294. }
  295. }
  296. //read
  297. if (do_read) {
  298. data.resize(info.uncompressed_size);
  299. unzOpenCurrentFile(pkg);
  300. unzReadCurrentFile(pkg, data.ptrw(), data.size());
  301. unzCloseCurrentFile(pkg);
  302. }
  303. if (path == "AppxManifest.xml") {
  304. data = _fix_manifest(p_preset, data, p_flags & (DEBUG_FLAG_DUMB_CLIENT | DEBUG_FLAG_REMOTE_DEBUG));
  305. }
  306. print_line("ADDING: " + path);
  307. err = packager.add_file(path, data.ptr(), data.size(), template_file_no++, template_files_amount, _should_compress_asset(path, data));
  308. if (err != OK) {
  309. return err;
  310. }
  311. ret = unzGoToNextFile(pkg);
  312. }
  313. EditorNode::progress_end_task("template_files");
  314. if (ep.step("Creating command line...", 2)) {
  315. return ERR_SKIP;
  316. }
  317. Vector<String> cl = ((String)p_preset->get("command_line/extra_args")).strip_edges().split(" ");
  318. for (int i = 0; i < cl.size(); i++) {
  319. if (cl[i].strip_edges().length() == 0) {
  320. cl.remove_at(i);
  321. i--;
  322. }
  323. }
  324. if (!(p_flags & DEBUG_FLAG_DUMB_CLIENT)) {
  325. cl.push_back("--path");
  326. cl.push_back("game");
  327. }
  328. gen_export_flags(cl, p_flags);
  329. // Command line file
  330. Vector<uint8_t> clf;
  331. // Argc
  332. clf.resize(4);
  333. encode_uint32(cl.size(), clf.ptrw());
  334. for (int i = 0; i < cl.size(); i++) {
  335. CharString txt = cl[i].utf8();
  336. int base = clf.size();
  337. clf.resize(base + 4 + txt.length());
  338. encode_uint32(txt.length(), &clf.write[base]);
  339. memcpy(&clf.write[base + 4], txt.ptr(), txt.length());
  340. print_line(itos(i) + " param: " + cl[i]);
  341. }
  342. err = packager.add_file("__cl__.cl", clf.ptr(), clf.size(), -1, -1, false);
  343. if (err != OK) {
  344. return err;
  345. }
  346. if (ep.step("Adding project files...", 3)) {
  347. return ERR_SKIP;
  348. }
  349. EditorNode::progress_add_task("project_files", "Project Files", 100);
  350. packager.set_progress_task("project_files");
  351. err = export_project_files(p_preset, p_debug, save_appx_file, &packager);
  352. EditorNode::progress_end_task("project_files");
  353. if (ep.step("Closing package...", 7)) {
  354. return ERR_SKIP;
  355. }
  356. unzClose(pkg);
  357. packager.finish();
  358. #ifdef WINDOWS_ENABLED
  359. // Sign with signtool
  360. String signtool_path = EDITOR_GET("export/uwp/signtool");
  361. if (signtool_path.is_empty()) {
  362. return OK;
  363. }
  364. if (!FileAccess::exists(signtool_path)) {
  365. ERR_PRINT("Could not find signtool executable at " + signtool_path + ", aborting.");
  366. return ERR_FILE_NOT_FOUND;
  367. }
  368. static String algs[] = { "MD5", "SHA1", "SHA256" };
  369. String cert_path = EDITOR_GET("export/uwp/debug_certificate");
  370. String cert_pass = EDITOR_GET("export/uwp/debug_password");
  371. int cert_alg = EDITOR_GET("export/uwp/debug_algorithm");
  372. if (!p_debug) {
  373. cert_path = p_preset->get_or_env("signing/certificate", ENV_UWP_SIGNING_CERT);
  374. cert_pass = p_preset->get_or_env("signing/password", ENV_UWP_SIGNING_PASS);
  375. cert_alg = p_preset->get("signing/algorithm");
  376. }
  377. if (cert_path.is_empty()) {
  378. return OK; // Certificate missing, don't try to sign
  379. }
  380. if (!FileAccess::exists(cert_path)) {
  381. ERR_PRINT("Could not find certificate file at " + cert_path + ", aborting.");
  382. return ERR_FILE_NOT_FOUND;
  383. }
  384. if (cert_alg < 0 || cert_alg > 2) {
  385. ERR_PRINT("Invalid certificate algorithm " + itos(cert_alg) + ", aborting.");
  386. return ERR_INVALID_DATA;
  387. }
  388. List<String> args;
  389. args.push_back("sign");
  390. args.push_back("/fd");
  391. args.push_back(algs[cert_alg]);
  392. args.push_back("/a");
  393. args.push_back("/f");
  394. args.push_back(cert_path);
  395. args.push_back("/p");
  396. args.push_back(cert_pass);
  397. args.push_back(p_path);
  398. OS::get_singleton()->execute(signtool_path, args);
  399. #endif // WINDOWS_ENABLED
  400. return OK;
  401. }
  402. void EditorExportPlatformUWP::get_platform_features(List<String> *r_features) const {
  403. r_features->push_back("pc");
  404. r_features->push_back("uwp");
  405. }
  406. void EditorExportPlatformUWP::resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, HashSet<String> &p_features) {
  407. }
  408. EditorExportPlatformUWP::EditorExportPlatformUWP() {
  409. #ifdef MODULE_SVG_ENABLED
  410. Ref<Image> img = memnew(Image);
  411. const bool upsample = !Math::is_equal_approx(Math::round(EDSCALE), EDSCALE);
  412. ImageLoaderSVG::create_image_from_string(img, _uwp_logo_svg, EDSCALE, upsample, false);
  413. logo = ImageTexture::create_from_image(img);
  414. #endif
  415. }