[bug] NSIS and WIX fails when application larger than 2GB
Describe the bug
Hello, I try to build software installer larger than 2GB but always get this compiler error indicating 2GB size limit. Similar error happens also when I use WIX. I know it is NSIS/WIX side issue but I still want to ask if there is an existing convient way from tauri side to fix this? That would save me a lot time.
Reproduction
- create an app larger than 2GB
- run
yarn tauri build --debug --verbose --bundles nsis
Expected behavior
msi / exe installer successfully created
Platform and versions
[✔] Environment
- OS: Windows 10.0.22621 X64
✔ WebView2: 114.0.1823.67
✔ MSVC: Visual Studio Community 2022
✔ rustc: 1.67.1 (d5a82bbd2 2023-02-07)
✔ Cargo: 1.67.1 (8ecd4f20a 2023-01-10)
✔ rustup: 1.25.2 (17db695f1 2023-02-01)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 16.16.0
- yarn: 1.22.19
- npm: 8.11.0
[-] Packages
- tauri [RUST]: 1.2.4
- tauri-build [RUST]: 1.2.1
- wry [RUST]: 0.23.4
- tao [RUST]: 0.15.8
- @tauri-apps/api [NPM]: 1.4.0
- @tauri-apps/cli [NPM]: 1.4.0
[-] App
- build-type: bundle
- CSP: unset
- distDir: ../dist
- devPath: http://localhost:1420/
- framework: Vue.js
- bundler: Vite
Stack trace
MakeNSIS v3.08 - Copyright 1999-2021 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.
Processing config: C:\Users\xxx\AppData\Local\tauri\NSIS\nsisconf.nsh
Processing script file: "C:\Users\xxx\src-tauri\target\debug\nsis\x64\installer.nsi" (UTF16LE)
Internal compiler error #12345: error mmapping file (2102998393, 33554432) is out of range.
Note: you may have one or two (large) stale temporary file(s) left in your temporary directory (Generally this only happens on Windows 9x).
Additional context
No response
Same problem I meet💔
I still want to ask if there is an existing convient way from tauri side to fix this?
Nope. As you said, it's a limitation of nsis and wix and they didn't just add this limitation, it's a technical limitation. In nsis case one of the main reasons is caused by nsis being 32bit afaik. Many years ago they also said that time to decompress and do crc checks would be another reason but whatever. And of course not all file system types like fat16 support files this large but that's probably not an issue for us/you either. There's a community fork trying to lift that limitation here https://sourceforge.net/projects/nsisbi/ but without having looked into it too much i wouldn't be comfortable to add that to tauri. no active maintenance, no docs, but at least source available...
For WiX i don't know the technical reasons but there is at least discussion to make it work in the future. v4 already made it possible for installers themselves to be larger than 2gb but it seems to be a manual process that i don't understand after just a quick look. Also, single files still have to be smaller than 2gb i think.
Sooo, i think a solution for wix is unrealistic but for nsis we could look into that fork if all the extensions we use are available as x64 too. (No ETA, i don't think it'll be a high prio for us any time soon)
I still want to ask if there is an existing convient way from tauri side to fix this?
Nope. As you said, it's a limitation of nsis and wix and they didn't just add this limitation, it's a technical limitation. In nsis case one of the main reasons is caused by nsis being 32bit afaik. Many years ago they also said that time to decompress and do crc checks would be another reason but whatever. And of course not all file system types like fat16 support files this large but that's probably not an issue for us/you either. There's a community fork trying to lift that limitation here https://sourceforge.net/projects/nsisbi/ but without having looked into it too much i wouldn't be comfortable to add that to tauri. no active maintenance, no docs, but at least source available...
For WiX i don't know the technical reasons but there is at least discussion to make it work in the future. v4 already made it possible for installers themselves to be larger than 2gb but it seems to be a manual process that i don't understand after just a quick look. Also, single files still have to be smaller than 2gb i think.
Sooo, i think a solution for wix is unrealistic but for nsis we could look into that fork if all the extensions we use are available as x64 too. (No ETA, i don't think it'll be a high prio for us any time soon)
Yes, just yesterday, I tried using nsisbi, but due to my unfamiliarity, it didn't succeed at least. I replaced its files following some simple methods on StackOverflow, and there were no errors during the build process. However, the final result was a failure, with the packaged file only being 100kb. I am still hoping for a mature solution from Tauri. Thank you for your efforts.
any hope about this? :(
Same issue here ...
Any tips in reducing build size? I already tried to remove files manually
Same issue here ...
Any tips in reducing build size? I already tried to remove files manually
I use inetc, a NSIS plugin, to download application from internet and extract to computer. So my installer itself is an Internet installer.
any tricks? I needed to include CUDA and CUDNN files in my app but they are too big :-(
I ended up using Inno without any shame :-P (it's open-source and easy to use). I tried many things, but they just didn't work. I just downloaded Inno, and a simple npm tauri build, then created a new installer with the exe file that Tauri creates in the release folder. I also added those big-naughty cuda and cudnn DLLs into my installer.
I recommend that way. Unfortunately, it's not appropriate for GitHub actions or cool way to fix this problem, but at least it's not death-end on my side :-)