Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix packaging on windows (documentation and file path limit) #4134

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# this allows us to use env vars in scripts in package.json crossplatform
shell-emulator=true
shell-emulator=true

# shorten paths in node_modules/.pnpm/<module>
# to not run into windows max length for paths (260 chars)
#
# The `pnpm pack:patch-node-modules` script needs the folder names for the stdio packages unchanged
# and longest folder name there is 49 chars currently so we sey it to 60 to be on the safe side.
virtual-store-dir-max-length=60
6 changes: 6 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ Possible options for `pnpm pack:generate_config`:

If you haven't done so run `pnpm build` now.

Then you need to run `pnpm pack:patch-node-modules` to patch `node_modules`. (**DON'T forget this step!**)
So that the `electron-builder` `afterPackHook` is able to find the rpc binaries.

Start electron-builder:

| Command | Description |
Expand All @@ -213,6 +216,9 @@ The commands for windows10 appx and the App Store package for mac are currently
- `mas` - mac appstore build
- `appx` - windows appstore build, you can find info on how to build a self-signed appx in [`APPX_TESTING.md`](./APPX_TESTING.md).

> If you are building window on windows you might run into the file path limit of 260 characters.
> To avoid that, make a folder with a short name directly on your drive (like c.tmp).

### Release Workflow <a id="release"></a>

See [RELEASE.md](../RELEASE.md)
Expand Down
11 changes: 10 additions & 1 deletion packages/target-electron/build/gen-electron-builder-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,20 @@ build['deb'] = {
}

build['win'] = {
artifactName: '${productName}-${version}.${arch}.${ext}',
icon: 'html-dist/images/deltachat.ico',
artifactName: '${productName}-${version}-Setup.${arch}.${ext}', // specifying it inside of build['nsis'] does not work for unknown reasons.
files: [...files, PREBUILD_FILTERS.NOT_MAC, PREBUILD_FILTERS.NOT_LINUX],
}

build['appx'] = {
// TODO: find out why this is not working
artifactName: '${productName}-${version}-Package.${arch}.${ext}',
}

build['portable'] = {
artifactName: '${productName}-${version}-Portable.${arch}.${ext}',
}

// supported languages are on https://learn.microsoft.com/en-us/windows/apps/publish/publish-your-app/supported-languages?pivots=store-installer-msix
const languages = [
'ar',
Expand Down
Loading