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