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 417732e commit 6afa20b
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 81 deletions.
80 changes: 23 additions & 57 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 @@ -78,7 +41,7 @@ class ProcedureExecutor {
* @returns
*/
async generateSLIP10Seed(outputLocation, sizeBytes) {
return await invoke("plugin:stronghold|execute_procedure", {
return await primitives.invoke("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
procedure: {
type: "SLIP10Generate",
Expand All @@ -99,7 +62,7 @@ class ProcedureExecutor {
* @returns
*/
async deriveSLIP10(chain, source, sourceLocation, outputLocation) {
return await invoke("plugin:stronghold|execute_procedure", {
return await primitives.invoke("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
procedure: {
type: "SLIP10Derive",
Expand All @@ -123,7 +86,7 @@ class ProcedureExecutor {
* @returns
*/
async recoverBIP39(mnemonic, outputLocation, passphrase) {
return await invoke("plugin:stronghold|execute_procedure", {
return await primitives.invoke("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
procedure: {
type: "BIP39Recover",
Expand All @@ -143,7 +106,7 @@ class ProcedureExecutor {
* @returns
*/
async generateBIP39(outputLocation, passphrase) {
return await invoke("plugin:stronghold|execute_procedure", {
return await primitives.invoke("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
procedure: {
type: "BIP39Generate",
Expand All @@ -162,7 +125,7 @@ class ProcedureExecutor {
* @since 2.0.0
*/
async getEd25519PublicKey(privateKeyLocation) {
return await invoke("plugin:stronghold|execute_procedure", {
return await primitives.invoke("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
procedure: {
type: "PublicKey",
Expand All @@ -182,7 +145,7 @@ class ProcedureExecutor {
* @since 2.0.0
*/
async signEd25519(privateKeyLocation, msg) {
return await invoke("plugin:stronghold|execute_procedure", {
return await primitives.invoke("plugin:stronghold|execute_procedure", {
...this.procedureArgs,
procedure: {
type: "Ed25519Sign",
Expand Down Expand Up @@ -218,14 +181,14 @@ class Store {
this.client = client;
}
async get(key) {
return await invoke("plugin:stronghold|get_store_record", {
return await primitives.invoke("plugin:stronghold|get_store_record", {
snapshotPath: this.path,
client: this.client,
key: toBytesDto(key),
}).then((v) => (v != null ? Uint8Array.from(v) : null));
}
async insert(key, value, lifetime) {
return await invoke("plugin:stronghold|save_store_record", {
return await primitives.invoke("plugin:stronghold|save_store_record", {
snapshotPath: this.path,
client: this.client,
key: toBytesDto(key),
Expand All @@ -234,7 +197,7 @@ class Store {
});
}
async remove(key) {
return await invoke("plugin:stronghold|remove_store_record", {
return await primitives.invoke("plugin:stronghold|remove_store_record", {
snapshotPath: this.path,
client: this.client,
key: toBytesDto(key),
Expand Down Expand Up @@ -265,7 +228,7 @@ class Vault extends ProcedureExecutor {
* @returns
*/
async insert(recordPath, secret) {
return await invoke("plugin:stronghold|save_secret", {
return await primitives.invoke("plugin:stronghold|save_secret", {
snapshotPath: this.path,
client: this.client,
vault: this.name,
Expand All @@ -280,7 +243,7 @@ class Vault extends ProcedureExecutor {
* @returns
*/
async remove(location) {
return await invoke("plugin:stronghold|remove_secret", {
return await primitives.invoke("plugin:stronghold|remove_secret", {
snapshotPath: this.path,
client: this.client,
vault: this.name,
Expand All @@ -307,7 +270,7 @@ class Stronghold {
* @returns
*/
static async load(path, password) {
return await invoke("plugin:stronghold|initialize", {
return await primitives.invoke("plugin:stronghold|initialize", {
snapshotPath: path,
password,
}).then(() => new Stronghold(path));
Expand All @@ -316,18 +279,18 @@ class Stronghold {
* Remove this instance from the cache.
*/
async unload() {
return await invoke("plugin:stronghold|destroy", {
return await primitives.invoke("plugin:stronghold|destroy", {
snapshotPath: this.path,
});
}
async loadClient(client) {
return await invoke("plugin:stronghold|load_client", {
return await primitives.invoke("plugin:stronghold|load_client", {
snapshotPath: this.path,
client: toBytesDto(client),
}).then(() => new Client(this.path, client));
}
async createClient(client) {
return await invoke("plugin:stronghold|create_client", {
return await primitives.invoke("plugin:stronghold|create_client", {
snapshotPath: this.path,
client: toBytesDto(client),
}).then(() => new Client(this.path, client));
Expand All @@ -337,11 +300,14 @@ class Stronghold {
* @returns
*/
async save() {
return await invoke("plugin:stronghold|save", {
return await primitives.invoke("plugin:stronghold|save", {
snapshotPath: this.path,
});
}
}

export { Client, Location, Store, Stronghold, Vault };
//# sourceMappingURL=index.min.js.map
exports.Client = Client;
exports.Location = Location;
exports.Store = Store;
exports.Stronghold = Stronghold;
exports.Vault = Vault;
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 @@ -305,4 +305,3 @@ class Stronghold {
}

export { Client, Location, Store, Stronghold, Vault };
//# sourceMappingURL=index.mjs.map
Loading

0 comments on commit 6afa20b

Please sign in to comment.