diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d037984..af343c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,11 +37,11 @@ jobs: - platform: 'windows-latest' target_platform: 'win32' target_arch: 'x64' - args: '' + args: '--target x86_64-pc-windows-msvc --config ./src-tauri/tauri.windows-x86_64.conf.json' - platform: 'windows-11-arm' target_platform: 'win32' target_arch: 'arm64' - args: '--target aarch64-pc-windows-msvc' + args: '--target aarch64-pc-windows-msvc --config ./src-tauri/tauri.windows-aarch64.conf.json' runs-on: ${{ matrix.platform }} steps: - name: 🚚 Checkout repository diff --git a/README.md b/README.md index e72f291..4b741c1 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,8 @@ Want to build/compile NeoDLP from the source code? Follow these simple steps to 5. Run build process (run the command based on your platform and architecture) ```shell # command for windows users -npm run tauri build # for both x64/ARM64 devices +npm run tauri:build:windows-x64 # for x64 devices +npm run tauri:build:windows-arm64 # for ARM64 devices # commands for linux users npm run tauri:build:linux-x64 # for x64 devices diff --git a/package.json b/package.json index 2f33a9d..04d5302 100644 --- a/package.json +++ b/package.json @@ -17,10 +17,10 @@ "tauri:build:macos-x64": "npm run tauri build -- --config ./src-tauri/tauri.macos-x86_64.conf.json", "tauri:dev:macos-arm64": "npm run tauri dev -- --config ./src-tauri/tauri.macos-aarch64.conf.json", "tauri:build:macos-arm64": "npm run tauri build -- --config ./src-tauri/tauri.macos-aarch64.conf.json", - "tauri:dev:windows-x64": "npm run tauri dev -- --target x86_64-pc-windows-msvc", - "tauri:build:windows-x64": "npm run tauri build -- --target x86_64-pc-windows-msvc", - "tauri:dev:windows-arm64": "npm run tauri dev -- --target aarch64-pc-windows-msvc", - "tauri:build:windows-arm64": "npm run tauri build -- --target aarch64-pc-windows-msvc", + "tauri:dev:windows-x64": "npm run tauri dev -- --config ./src-tauri/tauri.windows-x86_64.conf.json", + "tauri:build:windows-x64": "npm run tauri build -- --config ./src-tauri/tauri.windows-x86_64.conf.json", + "tauri:dev:windows-arm64": "npm run tauri dev -- --config ./src-tauri/tauri.windows-aarch64.conf.json", + "tauri:build:windows-arm64": "npm run tauri build -- --config ./src-tauri/tauri.windows-aarch64.conf.json", "download": "node ./scripts/download-bins.js" }, "dependencies": { diff --git a/src-tauri/tauri.windows-aarch64.conf.json b/src-tauri/tauri.windows-aarch64.conf.json new file mode 100644 index 0000000..792a2dc --- /dev/null +++ b/src-tauri/tauri.windows-aarch64.conf.json @@ -0,0 +1,63 @@ +{ + "identifier": "com.neosubhamoy.neodlp", + "build": { + "beforeDevCommand": "cargo build --target=aarch64-pc-windows-msvc --manifest-path=./src-tauri/msghost/Cargo.toml && npm run dev", + "beforeBuildCommand": "cargo build --release --target=aarch64-pc-windows-msvc --manifest-path=./src-tauri/msghost/Cargo.toml && npm run build", + "devUrl": "http://localhost:1420", + "frontendDist": "../dist" + }, + "app": { + "windows": [ + { + "title": "NeoDLP", + "width": 1080, + "height": 680, + "decorations": false, + "visible": false + } + ], + "security": { + "csp": null, + "capabilities": [ + "default", + "shell-scope" + ] + } + }, + "bundle": { + "active": true, + "targets": ["msi", "nsis"], + "createUpdaterArtifacts": true, + "licenseFile": "../LICENSE", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ], + "externalBin": [ + "binaries/yt-dlp", + "binaries/ffmpeg", + "binaries/ffprobe", + "binaries/aria2c", + "binaries/deno", + "binaries/neodlp-pot" + ], + "resources": { + "target/aarch64-pc-windows-msvc/release/neodlp-msghost.exe": "neodlp-msghost.exe", + "resources/msghost-manifest/windows/chrome.json": "chrome.json", + "resources/msghost-manifest/windows/firefox.json": "firefox.json", + "resources/plugins/yt-dlp-plugins/": "yt-dlp-plugins/" + }, + "windows": { + "wix": { + "fragmentPaths": ["installer/windows/wix/reg-fragment.wxs"], + "componentRefs": ["NeoDlpRegEntriesFragment"] + }, + "nsis": { + "installerHooks": "installer/windows/nsis/hooks.nsi" + } + } + } +} diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows-x86_64.conf.json similarity index 81% rename from src-tauri/tauri.windows.conf.json rename to src-tauri/tauri.windows-x86_64.conf.json index e18bc50..b894cf3 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows-x86_64.conf.json @@ -1,8 +1,8 @@ { "identifier": "com.neosubhamoy.neodlp", "build": { - "beforeDevCommand": "cargo build --manifest-path=./src-tauri/msghost/Cargo.toml && npm run dev", - "beforeBuildCommand": "cargo build --release --manifest-path=./src-tauri/msghost/Cargo.toml && npm run build", + "beforeDevCommand": "cargo build --target=x86_64-pc-windows-msvc --manifest-path=./src-tauri/msghost/Cargo.toml && npm run dev", + "beforeBuildCommand": "cargo build --release --target=x86_64-pc-windows-msvc --manifest-path=./src-tauri/msghost/Cargo.toml && npm run build", "devUrl": "http://localhost:1420", "frontendDist": "../dist" }, @@ -45,7 +45,7 @@ "binaries/neodlp-pot" ], "resources": { - "target/release/neodlp-msghost.exe": "neodlp-msghost.exe", + "target/x86_64-pc-windows-msvc/release/neodlp-msghost.exe": "neodlp-msghost.exe", "resources/msghost-manifest/windows/chrome.json": "chrome.json", "resources/msghost-manifest/windows/firefox.json": "firefox.json", "resources/plugins/yt-dlp-plugins/": "yt-dlp-plugins/" diff --git a/src/helpers/use-downloader.ts b/src/helpers/use-downloader.ts index 9f32dd0..19c7b20 100644 --- a/src/helpers/use-downloader.ts +++ b/src/helpers/use-downloader.ts @@ -201,9 +201,10 @@ export default function useDownloader() { const isFlatpak = await invoke('is_flatpak'); const xdgDataDir = await dataDir(); + const spawnOpts = { env: { PYTHONUNBUFFERED: '1' } }; const command = isFlatpak - ? Command.create('sh', ['-c', `${xdgDataDir}/yt-dlp/yt-dlp ${args.map(arg => `'${arg.replace(/'/g, "'\\''")}'`).join(' ')}`]) - : Command.sidecar('binaries/yt-dlp', args); + ? Command.create('sh', ['-c', `${xdgDataDir}/yt-dlp/yt-dlp ${args.map(arg => `'${arg.replace(/'/g, "'\\''")}'`).join(' ')}`], spawnOpts) + : Command.sidecar('binaries/yt-dlp', args, spawnOpts); let jsonOutput = '';