diff --git a/.github/workflows/release-cargo.yml b/.github/workflows/release-cargo.yml index afa11f68c..64d7e9911 100644 --- a/.github/workflows/release-cargo.yml +++ b/.github/workflows/release-cargo.yml @@ -18,23 +18,23 @@ jobs: - name: tauri-bundler registryName: tauri-bundler path: cli/tauri-bundler - publishPath: /target/package + publishPath: cli/tauri-bundler/target/package # not in workspace so target folder is nested - name: tauri-core registryName: tauri path: tauri - publishPath: /target/package + publishPath: target/package - name: tauri-api registryName: tauri-api path: tauri-api - publishPath: /target/package + publishPath: target/package - name: tauri-updater registryName: tauri-updater path: tauri-updater - publishPath: /target/package + publishPath: target/package - name: tauri-utils registryName: tauri-utils path: tauri-utils - publishPath: /target/package + publishPath: target/package steps: - uses: actions/checkout@v2 with: @@ -59,14 +59,9 @@ jobs: TAURI_DIST_DIR: ${{ runner.workspace }}/tauri/tauri/test/fixture/dist TAURI_DIR: ${{ runner.workspace }}/tauri/tauri/test/fixture/src-tauri run: | - echo "package dir:" - ls cargo package --no-verify echo "We will publish:" $PACKAGE_VERSION echo "This is current latest:" $PUBLISHED_VERSION - echo "post package dir:" - cd ${{ matrix.publishPath }} - ls - name: cargo audit if: env.PACKAGE_VERSION != env.PUBLISHED_VERSION working-directory: ${{ matrix.package.path }} diff --git a/cli/tauri-bundler/Cargo.toml b/cli/tauri-bundler/Cargo.toml index ca40f8da0..e283965e5 100644 --- a/cli/tauri-bundler/Cargo.toml +++ b/cli/tauri-bundler/Cargo.toml @@ -2,7 +2,7 @@ workspace = {} [package] name = "tauri-bundler" -version = "0.4.3" +version = "0.4.4" authors = ["George Burton ", "Lucas Fernandes Gonçalves Nogueira ", "Daniel Thompson-Yvetot ", "Tensor Programming "] license = "MIT/Apache-2.0" keywords = ["bundle", "cargo", "tauri"] diff --git a/cli/tauri-bundler/src/bundle/templates/main.wxs b/cli/tauri-bundler/src/bundle/templates/main.wxs index a97cd58e7..ed2dfb8ff 100644 --- a/cli/tauri-bundler/src/bundle/templates/main.wxs +++ b/cli/tauri-bundler/src/bundle/templates/main.wxs @@ -26,6 +26,10 @@ InstallScope="perMachine" SummaryCodepage="1252"/> + + + @@ -33,19 +37,36 @@ - + + + + + + 1 + 1 + + + - + - + @@ -64,7 +85,7 @@ Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" /> - - @@ -94,41 +114,42 @@ Title="Application" Description="Installs {{{product_name}}}." Level="1" - ConfigurableDirectory="APPLICATIONFOLDER" + ConfigurableDirectory="INSTALLDIR" AllowAdvertise="no" Display="expand" Absent="disallow"> {{#each resource_file_ids as |resource_file_id| ~}} - + {{/each~}} - - - - + Title="Shortcuts" + Level="1"> + + + + - - {{#each external_binaries as |external_bin| ~}} - - {{/each~}} + Id="Environment" + Title="PATH Environment Variable" + Description="Add the install location of the [ProductName] executable to the PATH system environment variable. This allows the [ProductName] executable to be called from any location." + Level="1" + Absent="allow"> + + {{#each external_binaries as |external_bin| ~}} + + {{/each~}} - + + diff --git a/cli/tauri-bundler/src/bundle/wix.rs b/cli/tauri-bundler/src/bundle/wix.rs index 4fd686c8a..ce416accd 100644 --- a/cli/tauri-bundler/src/bundle/wix.rs +++ b/cli/tauri-bundler/src/bundle/wix.rs @@ -18,8 +18,8 @@ use std::process::{Command, Stdio}; // URLS for the WIX toolchain. Can be used for crossplatform compilation. pub const WIX_URL: &str = - "https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311-binaries.zip"; -pub const WIX_SHA256: &str = "37f0a533b0978a454efb5dc3bd3598becf9660aaf4287e55bf68ca6b527d051d"; + "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip"; +pub const WIX_SHA256: &str = "2c1888d5d1dba377fc7fa14444cf556963747ff9a0a289a3599cf09da03b9e2e"; // For Cross Platform Complilation. @@ -348,7 +348,12 @@ fn run_light( ) -> crate::Result { let light_exe = wix_toolset_path.join("light.exe"); - let mut args: Vec = vec!["-o".to_string(), output_path.display().to_string()]; + let mut args: Vec = vec![ + "-ext".to_string(), + "WixUIExtension".to_string(), + "-o".to_string(), + output_path.display().to_string(), + ]; for p in wixobjs { args.push(p.to_string()); diff --git a/cli/tauri.js/package.json b/cli/tauri.js/package.json index 70a3fcc72..ff6decf19 100644 --- a/cli/tauri.js/package.json +++ b/cli/tauri.js/package.json @@ -1,6 +1,6 @@ { "name": "tauri", - "version": "0.4.4", + "version": "0.4.5", "description": "Multi-binding collection of libraries and templates for building Tauri apps", "bin": { "tauri": "./bin/tauri.js" @@ -49,7 +49,7 @@ "chalk": "3.0.0", "chokidar": "3.3.1", "cross-spawn": "7.0.1", - "fast-glob": "3.2.1", + "fast-glob": "3.2.2", "fs-extra": "8.1.0", "imagemin": "7.0.1", "imagemin-optipng": "7.1.0", @@ -77,8 +77,8 @@ "@types/ms": "0.7.31", "@types/sharp": "0.24.0", "@types/webpack-merge": "4.1.5", - "@typescript-eslint/eslint-plugin": "2.20.0", - "@typescript-eslint/parser": "2.20.0", + "@typescript-eslint/eslint-plugin": "2.21.0", + "@typescript-eslint/parser": "2.21.0", "dotenv": "8.2.0", "eslint": "6.8.0", "eslint-config-standard-with-typescript": "14.0.0", @@ -91,12 +91,12 @@ "husky": "4.2.3", "jest": "25.1.0", "jest-mock-process": "1.3.2", - "lint-staged": "10.0.7", + "lint-staged": "10.0.8", "lockfile-lint": "4.0.0", "promise": "8.0.3", "raw-loader": "4.0.0", "ts-loader": "6.2.1", - "typescript": "3.8.2", + "typescript": "3.8.3", "webpack": "4.41.6", "webpack-cli": "3.3.11", "webpack-node-externals": "1.7.2" @@ -109,4 +109,4 @@ "lint-staged": [ "eslint --fix" ] -} \ No newline at end of file +} diff --git a/cli/tauri.js/templates/src-tauri/Cargo.toml b/cli/tauri.js/templates/src-tauri/Cargo.toml index 03b5cef2a..ec814a548 100755 --- a/cli/tauri.js/templates/src-tauri/Cargo.toml +++ b/cli/tauri.js/templates/src-tauri/Cargo.toml @@ -2,7 +2,7 @@ name = "app" version = "0.1.0" description = "A Tauri App" -author = ["you"] +authors = ["you"] license = "" repository = "" default-run = "app" diff --git a/cli/tauri.js/templates/tauri.js b/cli/tauri.js/templates/tauri.js index 01818a975..94f781f79 100644 --- a/cli/tauri.js/templates/tauri.js +++ b/cli/tauri.js/templates/tauri.js @@ -18,6 +18,14 @@ * and also whitelist them based upon the developer's settings. */ +// polyfills +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0 + return this.substr(position, searchString.length) === searchString + } +} + // makes the window.external.invoke API available after window.location.href changes switch (navigator.platform) { @@ -166,7 +174,7 @@ window.tauri = { <% } %> transformCallback: function transformCallback(callback) { var once = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var identifier = Object.freeze(uid()); + var identifier = uid(); window[identifier] = function (result) { if (once) { @@ -209,7 +217,6 @@ window.tauri = { <% } %> readTextFile: function readTextFile(path) { <% if (tauri.whitelist.readTextFile === true || tauri.whitelist.all === true) { %> - Object.freeze(path); return this.promisified({ cmd: 'readTextFile', path: path @@ -233,7 +240,6 @@ window.tauri = { <% } %> readBinaryFile: function readBinaryFile(path) { <% if (tauri.whitelist.readBinaryFile === true || tauri.whitelist.all === true) { %> - Object.freeze(path); return this.promisified({ cmd: 'readBinaryFile', path: path @@ -258,7 +264,9 @@ window.tauri = { <% } %> writeFile: function writeFile(cfg) { <% if (tauri.whitelist.writeFile === true || tauri.whitelist.all === true) { %> - Object.freeze(cfg); + if (_typeof(cfg) === 'object') { + Object.freeze(cfg); + } this.invoke({ cmd: 'writeFile', file: cfg.file, @@ -283,8 +291,6 @@ window.tauri = { <% } %> listFiles: function listFiles(path) { <% if (tauri.whitelist.listFiles === true || tauri.whitelist.all === true) { %> - - Object.freeze(path); return this.promisified({ cmd: 'listFiles', path: path @@ -308,7 +314,6 @@ window.tauri = { <% } %> listDirs: function listDirs(path) { <% if (tauri.whitelist.listDirs === true || tauri.whitelist.all === true) { %> - Object.freeze(path); return this.promisified({ cmd: 'listDirs', path: path @@ -330,7 +335,6 @@ window.tauri = { <% } %> setTitle: function setTitle(title) { <% if (tauri.whitelist.setTitle === true || tauri.whitelist.all === true) { %> - Object.freeze(title); this.invoke({ cmd: 'setTitle', title: title @@ -352,7 +356,6 @@ window.tauri = { <% } %> open: function open(uri) { <% if (tauri.whitelist.open === true || tauri.whitelist.all === true) { %> - Object.freeze(uri); this.invoke({ cmd: 'open', uri: uri @@ -378,9 +381,7 @@ window.tauri = { execute: function execute(command, args) { <% if (tauri.whitelist.execute === true || tauri.whitelist.all === true) { %> - Object.freeze(command); - - if (typeof args === 'string' || _typeof(args) === 'object') { + if (_typeof(args) === 'object') { Object.freeze(args); } @@ -400,9 +401,7 @@ window.tauri = { bridge: function bridge(command, payload) { <% if (tauri.whitelist.bridge === true || tauri.whitelist.all === true) { %> - Object.freeze(command); - - if (typeof payload === 'string' || _typeof(payload) === 'object') { + if (_typeof(payload) === 'object') { Object.freeze(payload); } @@ -446,7 +445,7 @@ document.addEventListener('error', function (e) { while (target != null) { if (target.matches ? target.matches('img') : target.msMatchesSelector('img')) { window.tauri.loadAsset(target.src, 'image') - .then(img => { + .then(function (img) { target.src = img }) break @@ -463,6 +462,7 @@ function __openLinks() { if (target.matches ? target.matches('a') : target.msMatchesSelector('a')) { if (target.href && target.href.startsWith('http') && target.target === '_blank') { window.tauri.open(target.href) + e.preventDefault() } break } diff --git a/cli/tauri.js/yarn.lock b/cli/tauri.js/yarn.lock index 1956cdc14..6d7bbd0b2 100644 --- a/cli/tauri.js/yarn.lock +++ b/cli/tauri.js/yarn.lock @@ -766,12 +766,12 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@2.20.0": - version "2.20.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.20.0.tgz#a522d0e1e4898f7c9c6a8e1ed3579b60867693fa" - integrity sha512-cimIdVDV3MakiGJqMXw51Xci6oEDEoPkvh8ggJe2IIzcc0fYqAxOXN6Vbeanahz6dLZq64W+40iUEc9g32FLDQ== +"@typescript-eslint/eslint-plugin@2.21.0": + version "2.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.21.0.tgz#a34de84a0791cae0357c4dda805c5b4e8203b6c6" + integrity sha512-b5jjjDMxzcjh/Sbjuo7WyhrQmVJg0WipTHQgXh5Xwx10uYm6nPWqN1WGOsaNq4HR3Zh4wUx4IRQdDkCHwyewyw== dependencies: - "@typescript-eslint/experimental-utils" "2.20.0" + "@typescript-eslint/experimental-utils" "2.21.0" eslint-utils "^1.4.3" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" @@ -786,7 +786,26 @@ "@typescript-eslint/typescript-estree" "2.20.0" eslint-scope "^5.0.0" -"@typescript-eslint/parser@2.20.0", "@typescript-eslint/parser@^2.19.2": +"@typescript-eslint/experimental-utils@2.21.0": + version "2.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.21.0.tgz#71de390a3ec00b280b69138d80733406e6e86bfa" + integrity sha512-olKw9JP/XUkav4lq0I7S1mhGgONJF9rHNhKFn9wJlpfRVjNo3PPjSvybxEldvCXnvD+WAshSzqH5cEjPp9CsBA== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.21.0" + eslint-scope "^5.0.0" + +"@typescript-eslint/parser@2.21.0": + version "2.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.21.0.tgz#4f200995517c3d5fc5ef51b17527bc948992e438" + integrity sha512-VrmbdrrrvvI6cPPOG7uOgGUFXNYTiSbnRq8ZMyuGa4+qmXJXVLEEz78hKuqupvkpwJQNk1Ucz1TenrRP90gmBg== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.21.0" + "@typescript-eslint/typescript-estree" "2.21.0" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/parser@^2.19.2": version "2.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.20.0.tgz#608e5bb06ba98a415b64ace994c79ab20f9772a9" integrity sha512-o8qsKaosLh2qhMZiHNtaHKTHyCHc3Triq6aMnwnWj7budm3xAY9owSZzV1uon5T9cWmJRJGzTFa90aex4m77Lw== @@ -809,6 +828,19 @@ semver "^6.3.0" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@2.21.0": + version "2.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.21.0.tgz#7e4be29f2e338195a2e8c818949ed0ff727cc943" + integrity sha512-NC/nogZNb9IK2MEFQqyDBAciOT8Lp8O3KgAfvHx2Skx6WBo+KmDqlU3R9KxHONaijfTIKtojRe3SZQyMjr3wBw== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^6.3.0" + tsutils "^3.17.1" + "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" @@ -3254,10 +3286,10 @@ fast-deep-equal@^2.0.1: resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= -fast-glob@3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.1.tgz#c5aaea632f92543b744bdcb19f11efd49e56c7b3" - integrity sha512-XObtOQLTl4EptWcBbO9O6wd17VlVf9YXYY/zuzuu7nZfTsv4BL3KupMAMUVzH88CUwWkI3uNHBfxtfU8PveVTQ== +fast-glob@3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.2.tgz#ade1a9d91148965d4bf7c51f72e1ca662d32e63d" + integrity sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -5229,10 +5261,10 @@ lines-and-columns@^1.1.6: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -lint-staged@10.0.7: - version "10.0.7" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.0.7.tgz#d205f92d9359419a23bc6aa3b6f8546b1998da64" - integrity sha512-Byj0F4l7GYUpYYHEqyFH69NiI6ICTg0CeCKbhRorL+ickbzILKUlZLiyCkljZV02wnoh7yH7PmFyYm9PRNwk9g== +lint-staged@10.0.8: + version "10.0.8" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.0.8.tgz#0f7849cdc336061f25f5d4fcbcfa385701ff4739" + integrity sha512-Oa9eS4DJqvQMVdywXfEor6F4vP+21fPHF8LUXgBbVWUSWBddjqsvO6Bv1LwMChmgQZZqwUvgJSHlu8HFHAPZmA== dependencies: chalk "^3.0.0" commander "^4.0.1" @@ -8304,10 +8336,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@3.8.2: - version "3.8.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.2.tgz#91d6868aaead7da74f493c553aeff76c0c0b1d5a" - integrity sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ== +typescript@3.8.3: + version "3.8.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" + integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== uglify-js@^3.7.4: version "3.7.6" diff --git a/tauri/Cargo.toml b/tauri/Cargo.toml index d04ae458a..b8d841a56 100644 --- a/tauri/Cargo.toml +++ b/tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri" -version = "0.4.2" +version = "0.4.3" authors = ["Lucas Fernandes Gonçalves Nogueira ", "Daniel Thompson-Yvetot ", "Tensor Programming "] license = "MIT" homepage = "https://tauri.studio" diff --git a/tauri/src/app/runner.rs b/tauri/src/app/runner.rs index de6103326..d5ce62081 100644 --- a/tauri/src/app/runner.rs +++ b/tauri/src/app/runner.rs @@ -217,7 +217,7 @@ fn build_webview( Content::Html(ref html) => html, Content::Url(ref url) => url, }; - webview.eval(&format!("window.location.href = `{}`", content_href))?; + webview.eval(&format!(r#"window.location.href = "{}""#, content_href))?; } else if let Ok(b) = crate::endpoints::handle(webview, arg) { if !b { application.run_invoke_handler(webview, arg); diff --git a/tauri/src/endpoints.rs b/tauri/src/endpoints.rs index 943340c6e..18e4b6b35 100644 --- a/tauri/src/endpoints.rs +++ b/tauri/src/endpoints.rs @@ -243,7 +243,7 @@ fn load_asset( "jpeg" }; Ok(format!( - "`data:image/{};base64,{}`", + r#""data:image/{};base64,{}""#, ext, base64::encode(&read_asset.expect("Failed to read asset type").into_owned()) )) @@ -259,7 +259,7 @@ fn load_asset( _webview.eval(asset_str) } }) - .map_err(|err| crate::ErrorKind::Promise(format!("`{}`", err)).into()) + .map_err(|err| crate::ErrorKind::Promise(format!(r#""{}""#, err)).into()) .map(|_| r#""Asset loaded successfully""#.to_string()) } }, diff --git a/tauri/src/lib.rs b/tauri/src/lib.rs index 8ced19d61..18e1d8134 100644 --- a/tauri/src/lib.rs +++ b/tauri/src/lib.rs @@ -89,7 +89,7 @@ pub fn call( || { api::command::get_output(command, args, Stdio::piped()) .map_err(|err| crate::ErrorKind::Promise(err.to_string()).into()) - .map(|output| format!("`{}`", output)) + .map(|output| format!(r#""{}""#, output)) }, callback, error,