mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
committed by
GitHub
parent
8e23870189
commit
66efb43388
@@ -37,30 +37,27 @@ Here's a Node.js script to append the target triple to a binary:
|
||||
const execa = require('execa')
|
||||
const fs = require('fs')
|
||||
|
||||
let extension = ''
|
||||
if (process.platform === 'win32') {
|
||||
extension = '.exe'
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const rustTargetInfo = JSON.parse(
|
||||
(
|
||||
await execa(
|
||||
'rustc',
|
||||
['-Z', 'unstable-options', '--print', 'target-spec-json'],
|
||||
{
|
||||
env: {
|
||||
RUSTC_BOOTSTRAP: 1
|
||||
}
|
||||
}
|
||||
)
|
||||
).stdout
|
||||
)
|
||||
const platformPostfix = rustTargetInfo['llvm-target']
|
||||
const rustInfo = (await execa('rustc', ['-vV'])).stdout
|
||||
const targetTriple = /host: (\S+)/g.exec(rustInfo)[1]
|
||||
if (!targetTriple) {
|
||||
console.error('Failed to determine platform target triple')
|
||||
}
|
||||
fs.renameSync(
|
||||
'src-tauri/binaries/app',
|
||||
`src-tauri/binaries/app-${platformPostfix}`
|
||||
`src-tauri/binaries/app${extension}`,
|
||||
`src-tauri/binaries/app-${targetTriple}${extension}`
|
||||
)
|
||||
}
|
||||
|
||||
main().catch((e) => {
|
||||
throw e
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
## Running the sidecar binary on JavaScript
|
||||
|
||||
@@ -12,23 +12,14 @@ if (process.platform === 'win32') {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const rustTargetInfo = JSON.parse(
|
||||
(
|
||||
await execa(
|
||||
'rustc',
|
||||
['-Z', 'unstable-options', '--print', 'target-spec-json'],
|
||||
{
|
||||
env: {
|
||||
RUSTC_BOOTSTRAP: 1
|
||||
}
|
||||
}
|
||||
)
|
||||
).stdout
|
||||
)
|
||||
const platformPostfix = rustTargetInfo['llvm-target']
|
||||
const rustInfo = (await execa('rustc', ['-vV'])).stdout
|
||||
const targetTriple = /host: (\S+)/g.exec(rustInfo)[1]
|
||||
if (!targetTriple) {
|
||||
console.error('Failed to determine platform target triple')
|
||||
}
|
||||
fs.renameSync(
|
||||
`src-tauri/binaries/app${extension}`,
|
||||
`src-tauri/binaries/app-${platformPostfix}${extension}`
|
||||
`src-tauri/binaries/app-${targetTriple}${extension}`
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,6 @@ pub fn build_wix_app_installer(
|
||||
data.insert("binaries", binaries_json);
|
||||
|
||||
let resources = generate_resource_data(settings)?;
|
||||
println!("{:?}", serde_json::to_string(&resources).unwrap());
|
||||
let mut resources_wix_string = String::from("");
|
||||
let mut files_ids = Vec::new();
|
||||
for (_, dir) in resources {
|
||||
|
||||
Reference in New Issue
Block a user