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 2decc3a commit f9cde6e
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 187 deletions.
173 changes: 34 additions & 139 deletions dist-js/index.min.js → dist-js/index.cjs
Original file line number Diff line number Diff line change
@@ -1,124 +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 */


function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}

function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}

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';

// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
var _Channel_onmessage;
/**
* Invoke your custom commands.
*
* This package is also accessible with `window.__TAURI__.tauri` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
* @module
*/
/**
* Transforms a callback function to a string identifier that can be passed to the backend.
* The backend uses the identifier to `eval()` the callback.
*
* @return A unique identifier associated with the callback function.
*
* @since 1.0.0
*/
function transformCallback(callback, once = false) {
return window.__TAURI_INTERNALS__.transformCallback(callback, once);
}
class Channel {
constructor() {
// @ts-expect-error field used by the IPC serializer
this.__TAURI_CHANNEL_MARKER__ = true;
_Channel_onmessage.set(this, () => {
// no-op
});
this.id = transformCallback((response) => {
__classPrivateFieldGet(this, _Channel_onmessage, "f").call(this, response);
});
}
set onmessage(handler) {
__classPrivateFieldSet(this, _Channel_onmessage, handler, "f");
}
get onmessage() {
return __classPrivateFieldGet(this, _Channel_onmessage, "f");
}
toJSON() {
return `__CHANNEL__:${this.id}`;
}
}
_Channel_onmessage = new WeakMap();
class PluginListener {
constructor(plugin, event, channelId) {
this.plugin = plugin;
this.event = event;
this.channelId = channelId;
}
async unregister() {
return invoke(`plugin:${this.plugin}|remove_listener`, {
event: this.event,
channelId: this.channelId
});
}
}
/**
* Adds a listener to a plugin event.
*
* @returns The listener object to stop listening to the events.
*
* @since 2.0.0
*/
async function addPluginListener(plugin, event, cb) {
const handler = new Channel();
handler.onmessage = cb;
return invoke(`plugin:${plugin}|register_listener`, { event, handler }).then(() => new PluginListener(plugin, event, handler.id));
}
/**
* 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 All @@ -143,20 +25,20 @@ var ScheduleEvery;
*/
ScheduleEvery["Second"] = "second";
})(ScheduleEvery || (ScheduleEvery = {}));
var Importance;
exports.Importance = void 0;
(function (Importance) {
Importance[Importance["None"] = 0] = "None";
Importance[Importance["Min"] = 1] = "Min";
Importance[Importance["Low"] = 2] = "Low";
Importance[Importance["Default"] = 3] = "Default";
Importance[Importance["High"] = 4] = "High";
})(Importance || (Importance = {}));
var Visibility;
})(exports.Importance || (exports.Importance = {}));
exports.Visibility = void 0;
(function (Visibility) {
Visibility[Visibility["Secret"] = -1] = "Secret";
Visibility[Visibility["Private"] = 0] = "Private";
Visibility[Visibility["Public"] = 1] = "Public";
})(Visibility || (Visibility = {}));
})(exports.Visibility || (exports.Visibility = {}));
/**
* Checks if the permission to send notifications is granted.
* @example
Expand All @@ -171,7 +53,7 @@ async function isPermissionGranted() {
if (window.Notification.permission !== "default") {
return Promise.resolve(window.Notification.permission === "granted");
}
return invoke("plugin:notification|is_permission_granted");
return primitives.invoke("plugin:notification|is_permission_granted");
}
/**
* Requests the permission to send notifications.
Expand Down Expand Up @@ -240,7 +122,7 @@ function sendNotification(options) {
* @since 2.0.0
*/
async function registerActionTypes(types) {
return invoke("plugin:notification|register_action_types", { types });
return primitives.invoke("plugin:notification|register_action_types", { types });
}
/**
* Retrieves the list of pending notifications.
Expand All @@ -256,7 +138,7 @@ async function registerActionTypes(types) {
* @since 2.0.0
*/
async function pending() {
return invoke("plugin:notification|get_pending");
return primitives.invoke("plugin:notification|get_pending");
}
/**
* Cancels the pending notifications with the given list of identifiers.
Expand All @@ -272,7 +154,7 @@ async function pending() {
* @since 2.0.0
*/
async function cancel(notifications) {
return invoke("plugin:notification|cancel", { notifications });
return primitives.invoke("plugin:notification|cancel", { notifications });
}
/**
* Cancels all pending notifications.
Expand All @@ -288,7 +170,7 @@ async function cancel(notifications) {
* @since 2.0.0
*/
async function cancelAll() {
return invoke("plugin:notification|cancel");
return primitives.invoke("plugin:notification|cancel");
}
/**
* Retrieves the list of active notifications.
Expand All @@ -304,7 +186,7 @@ async function cancelAll() {
* @since 2.0.0
*/
async function active() {
return invoke("plugin:notification|get_active");
return primitives.invoke("plugin:notification|get_active");
}
/**
* Removes the active notifications with the given list of identifiers.
Expand All @@ -320,7 +202,7 @@ async function active() {
* @since 2.0.0
*/
async function removeActive(notifications) {
return invoke("plugin:notification|remove_active", { notifications });
return primitives.invoke("plugin:notification|remove_active", { notifications });
}
/**
* Removes all active notifications.
Expand All @@ -336,7 +218,7 @@ async function removeActive(notifications) {
* @since 2.0.0
*/
async function removeAllActive() {
return invoke("plugin:notification|remove_active");
return primitives.invoke("plugin:notification|remove_active");
}
/**
* Creates a notification channel.
Expand All @@ -359,7 +241,7 @@ async function removeAllActive() {
* @since 2.0.0
*/
async function createChannel(channel) {
return invoke("plugin:notification|create_channel", { ...channel });
return primitives.invoke("plugin:notification|create_channel", { ...channel });
}
/**
* Removes the channel with the given identifier.
Expand All @@ -375,7 +257,7 @@ async function createChannel(channel) {
* @since 2.0.0
*/
async function removeChannel(id) {
return invoke("plugin:notification|delete_channel", { id });
return primitives.invoke("plugin:notification|delete_channel", { id });
}
/**
* Retrieves the list of notification channels.
Expand All @@ -391,14 +273,27 @@ async function removeChannel(id) {
* @since 2.0.0
*/
async function channels() {
return invoke("plugin:notification|listChannels");
return primitives.invoke("plugin:notification|listChannels");
}
async function onNotificationReceived(cb) {
return addPluginListener("notification", "notification", cb);
return primitives.addPluginListener("notification", "notification", cb);
}
async function onAction(cb) {
return addPluginListener("notification", "actionPerformed", cb);
return primitives.addPluginListener("notification", "actionPerformed", cb);
}

export { Importance, Visibility, active, cancel, cancelAll, channels, createChannel, isPermissionGranted, onAction, onNotificationReceived, pending, registerActionTypes, removeActive, removeAllActive, removeChannel, requestPermission, sendNotification };
//# sourceMappingURL=index.min.js.map
exports.active = active;
exports.cancel = cancel;
exports.cancelAll = cancelAll;
exports.channels = channels;
exports.createChannel = createChannel;
exports.isPermissionGranted = isPermissionGranted;
exports.onAction = onAction;
exports.onNotificationReceived = onNotificationReceived;
exports.pending = pending;
exports.registerActionTypes = registerActionTypes;
exports.removeActive = removeActive;
exports.removeAllActive = removeAllActive;
exports.removeChannel = removeChannel;
exports.requestPermission = requestPermission;
exports.sendNotification = sendNotification;
1 change: 0 additions & 1 deletion dist-js/index.mjs → dist-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,3 @@ async function onAction(cb) {
}

export { Importance, Visibility, active, cancel, cancelAll, channels, createChannel, isPermissionGranted, onAction, onNotificationReceived, pending, registerActionTypes, removeActive, removeAllActive, removeChannel, requestPermission, sendNotification };
//# sourceMappingURL=index.mjs.map
Loading

0 comments on commit f9cde6e

Please sign in to comment.