Skip to content

Commit a4f56e9

Browse files
authored
Custom Windows Installer & Uninstaller (#9815)
This PR introduces a new installer and uninstaller for the Windows platform. Both are written in Rust and compiled to a single executable. The executable has no dependencies (other than what is included in the Windows), links the C++ runtime statically if needed. The change is motivated by numerous issues with with the `electron-builder`-generated installers. The new installer should behave better, not have issues with long paths and unblock the `electron-builder` upgrade (which will significantly simplify the workflow definitions). To build an installer, one needs to provide the unpacked application (generated by `electron-builder`) and the `electron-builder` configuration (with a few minor extensions). Code signing is also supported.
1 parent ced7ba2 commit a4f56e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4066
-343
lines changed

.cargo/config.toml

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ rustflags = ["--cfg", "tokio_unstable"]
44

55
[target.wasm32-unknown-unknown]
66
rustflags = [
7-
# Increas the stack size from 1MB to 2MB. This is required to avoid running out of stack space
8-
# in debug builds. The error is reported as `RuntimeError: memory access out of bounds`.
9-
"-C",
10-
"link-args=-z stack-size=2097152",
7+
# Increas the stack size from 1MB to 2MB. This is required to avoid running out of stack space
8+
# in debug builds. The error is reported as `RuntimeError: memory access out of bounds`.
9+
"-C",
10+
"link-args=-z stack-size=2097152",
1111
]
1212

1313
[target.x86_64-pc-windows-msvc]
14-
rustflags = ["-C", "link-arg=/STACK:2097152"]
14+
# Static linking is required to avoid the need for the Visual C++ Redistributable. We care about this primarily for our
15+
# installer binary package.
16+
rustflags = ["-C", "link-arg=/STACK:2097152", "-C", "target-feature=+crt-static"]
1517

1618
[target.x86_64-pc-windows-gnu]
1719
rustflags = ["-C", "link-arg=-Wl,--stack,2097152"]

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ project/metals.sbt
117117
/build.json
118118
/app/ide-desktop/lib/client/electron-builder-config.json
119119

120+
# Resources fire generated build-time for Win installer/uninstaller.
121+
/build/install/installer/archive.rc
122+
/build/install/icon.rc
123+
120124

121125
#################
122126
## Build Cache ##

0 commit comments

Comments
 (0)