Skip to content

Commit

Permalink
fix(updater): Use escaped installer path to start the nsis updater (#…
Browse files Browse the repository at this point in the history
…727)

Port of v1 change: tauri-apps/tauri#7956

Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/6877612128

Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
  • Loading branch information
2 people authored and tauri-bot committed Nov 15, 2023
1 parent b638d02 commit 7dee7bd
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 122 deletions.
83 changes: 23 additions & 60 deletions dist-js/index.min.js → dist-js/index.cjs
Original file line number Diff line number Diff line change
@@ -1,43 +1,6 @@
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */


typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
'use strict';

/**
* Sends a message to the backend.
* @example
* ```typescript
* import { invoke } from '@tauri-apps/api/primitives';
* await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });
* ```
*
* @param cmd The command name.
* @param args The optional arguments to pass to the command.
* @param options The request options.
* @return A promise resolving or rejecting to the backend response.
*
* @since 1.0.0
*/
async function invoke(cmd, args = {}, options) {
return window.__TAURI_INTERNALS__.invoke(cmd, args, options);
}
var primitives = require('@tauri-apps/api/primitives');

// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -98,7 +61,7 @@ async function open(options = {}) {
if (typeof options === "object") {
Object.freeze(options);
}
return invoke("plugin:dialog|open", { options });
return primitives.invoke("plugin:dialog|open", { options });
}
/**
* Open a file/directory save dialog.
Expand Down Expand Up @@ -128,7 +91,7 @@ async function save(options = {}) {
if (typeof options === "object") {
Object.freeze(options);
}
return invoke("plugin:dialog|save", { options });
return primitives.invoke("plugin:dialog|save", { options });
}
/**
* Shows a message dialog with an `Ok` button.
Expand All @@ -148,13 +111,12 @@ async function save(options = {}) {
*
*/
async function message(message, options) {
var _a, _b;
const opts = typeof options === "string" ? { title: options } : options;
return invoke("plugin:dialog|message", {
return primitives.invoke("plugin:dialog|message", {
message: message.toString(),
title: (_a = opts === null || opts === void 0 ? void 0 : opts.title) === null || _a === void 0 ? void 0 : _a.toString(),
type_: opts === null || opts === void 0 ? void 0 : opts.type,
okButtonLabel: (_b = opts === null || opts === void 0 ? void 0 : opts.okLabel) === null || _b === void 0 ? void 0 : _b.toString(),
title: opts?.title?.toString(),
type_: opts?.type,
okButtonLabel: opts?.okLabel?.toString(),
});
}
/**
Expand All @@ -174,14 +136,13 @@ async function message(message, options) {
* @since 2.0.0
*/
async function ask(message, options) {
var _a, _b, _c, _d, _e;
const opts = typeof options === "string" ? { title: options } : options;
return invoke("plugin:dialog|ask", {
return primitives.invoke("plugin:dialog|ask", {
message: message.toString(),
title: (_a = opts === null || opts === void 0 ? void 0 : opts.title) === null || _a === void 0 ? void 0 : _a.toString(),
type_: opts === null || opts === void 0 ? void 0 : opts.type,
okButtonLabel: (_c = (_b = opts === null || opts === void 0 ? void 0 : opts.okLabel) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : "Yes",
cancelButtonLabel: (_e = (_d = opts === null || opts === void 0 ? void 0 : opts.cancelLabel) === null || _d === void 0 ? void 0 : _d.toString()) !== null && _e !== void 0 ? _e : "No",
title: opts?.title?.toString(),
type_: opts?.type,
okButtonLabel: opts?.okLabel?.toString() ?? "Yes",
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "No",
});
}
/**
Expand All @@ -201,16 +162,18 @@ async function ask(message, options) {
* @since 2.0.0
*/
async function confirm(message, options) {
var _a, _b, _c, _d, _e;
const opts = typeof options === "string" ? { title: options } : options;
return invoke("plugin:dialog|confirm", {
return primitives.invoke("plugin:dialog|confirm", {
message: message.toString(),
title: (_a = opts === null || opts === void 0 ? void 0 : opts.title) === null || _a === void 0 ? void 0 : _a.toString(),
type_: opts === null || opts === void 0 ? void 0 : opts.type,
okButtonLabel: (_c = (_b = opts === null || opts === void 0 ? void 0 : opts.okLabel) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : "Ok",
cancelButtonLabel: (_e = (_d = opts === null || opts === void 0 ? void 0 : opts.cancelLabel) === null || _d === void 0 ? void 0 : _d.toString()) !== null && _e !== void 0 ? _e : "Cancel",
title: opts?.title?.toString(),
type_: opts?.type,
okButtonLabel: opts?.okLabel?.toString() ?? "Ok",
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "Cancel",
});
}

export { ask, confirm, message, open, save };
//# sourceMappingURL=index.min.js.map
exports.ask = ask;
exports.confirm = confirm;
exports.message = message;
exports.open = open;
exports.save = save;
26 changes: 11 additions & 15 deletions dist-js/index.mjs → dist-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,12 @@ async function save(options = {}) {
*
*/
async function message(message, options) {
var _a, _b;
const opts = typeof options === "string" ? { title: options } : options;
return invoke("plugin:dialog|message", {
message: message.toString(),
title: (_a = opts === null || opts === void 0 ? void 0 : opts.title) === null || _a === void 0 ? void 0 : _a.toString(),
type_: opts === null || opts === void 0 ? void 0 : opts.type,
okButtonLabel: (_b = opts === null || opts === void 0 ? void 0 : opts.okLabel) === null || _b === void 0 ? void 0 : _b.toString(),
title: opts?.title?.toString(),
type_: opts?.type,
okButtonLabel: opts?.okLabel?.toString(),
});
}
/**
Expand All @@ -135,14 +134,13 @@ async function message(message, options) {
* @since 2.0.0
*/
async function ask(message, options) {
var _a, _b, _c, _d, _e;
const opts = typeof options === "string" ? { title: options } : options;
return invoke("plugin:dialog|ask", {
message: message.toString(),
title: (_a = opts === null || opts === void 0 ? void 0 : opts.title) === null || _a === void 0 ? void 0 : _a.toString(),
type_: opts === null || opts === void 0 ? void 0 : opts.type,
okButtonLabel: (_c = (_b = opts === null || opts === void 0 ? void 0 : opts.okLabel) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : "Yes",
cancelButtonLabel: (_e = (_d = opts === null || opts === void 0 ? void 0 : opts.cancelLabel) === null || _d === void 0 ? void 0 : _d.toString()) !== null && _e !== void 0 ? _e : "No",
title: opts?.title?.toString(),
type_: opts?.type,
okButtonLabel: opts?.okLabel?.toString() ?? "Yes",
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "No",
});
}
/**
Expand All @@ -162,16 +160,14 @@ async function ask(message, options) {
* @since 2.0.0
*/
async function confirm(message, options) {
var _a, _b, _c, _d, _e;
const opts = typeof options === "string" ? { title: options } : options;
return invoke("plugin:dialog|confirm", {
message: message.toString(),
title: (_a = opts === null || opts === void 0 ? void 0 : opts.title) === null || _a === void 0 ? void 0 : _a.toString(),
type_: opts === null || opts === void 0 ? void 0 : opts.type,
okButtonLabel: (_c = (_b = opts === null || opts === void 0 ? void 0 : opts.okLabel) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : "Ok",
cancelButtonLabel: (_e = (_d = opts === null || opts === void 0 ? void 0 : opts.cancelLabel) === null || _d === void 0 ? void 0 : _d.toString()) !== null && _e !== void 0 ? _e : "Cancel",
title: opts?.title?.toString(),
type_: opts?.type,
okButtonLabel: opts?.okLabel?.toString() ?? "Ok",
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "Cancel",
});
}

export { ask, confirm, message, open, save };
//# sourceMappingURL=index.mjs.map
1 change: 0 additions & 1 deletion dist-js/index.min.js.map

This file was deleted.

Loading

0 comments on commit 7dee7bd

Please sign in to comment.