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

Failed to create dylib symbolic link on Windows #8149

Open
kochizufan opened this issue Mar 22, 2024 · 6 comments
Open

Failed to create dylib symbolic link on Windows #8149

kochizufan opened this issue Mar 22, 2024 · 6 comments

Comments

@kochizufan
Copy link

  • Electron-Builder Version: 24.13.3
  • Node Version: v18.16.1
  • Electron Version: 29.1.5
  • Electron Type (current, beta, nightly): current
  • Target: Both NSIS and portable on Windows (Both results are same)

I tried to make Windows installer of my app with following command and settings:

electron-builder --win --x64 --config ./build_win.js

build_win.js

const config = {
  "appId": "jp.maplat.editor",
  "directories": {
    "output": "dist"
  },
  "files": [
    "assets/win",
    "backend",
    "css",
    "frontend/api",
    "frontend/dist",
    "frontend/fonts",
    "html",
    "img",
    "locales",
    "package.json",
    "package-lock.json",
    "tms_list.json"
  ],
  "win": {
    "icon": "assets/win/icon_win.ico",
    "target": "portable"
  },
  "nsis":{
    "oneClick": false,
    "allowToChangeInstallationDirectory": true
  }
};

module.exports = config;

But it is failed with following errors:

  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z size=5.6 MB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z duration=1.104s
  ⨯ cannot execute  cause=exit status 2
                    out=
    7-Zip (a) 21.07 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-12-26

    Scanning the drive for archives:
    1 file, 5635384 bytes (5504 KiB)

    Extracting archive: C:\Users\kochi\AppData\Local\electron-builder\Cache\winCodeSign\618674575.7z
    --
    Path = C:\Users\kochi\AppData\Local\electron-builder\Cache\winCodeSign\618674575.7z
    Type = 7z
    Physical Size = 5635384
    Headers Size = 1492
    Method = LZMA2:24m LZMA:20 BCJ2
    Solid = +
    Blocks = 2


    Sub items Errors: 2

    Archives with Errors: 1

    Sub items Errors: 2

                    errorOut=ERROR: Cannot create symbolic link : �N���C�A���g�͗v�����ꂽ�������ۗL���Ă��܂����B : C:\Users\kochi\AppData\Local\electron-builder\Cache\winCodeS Sign\618674575\darwin\10.12\lib\libcrypto.dylib
    ERROR: Cannot create symbolic link : �N���C�A���g�͗v�����ꂽ�������ۗL���Ă��܂����B : C:\Users\kochi\AppData\Local\electron-builder\Cache\winCodeSign\618674575\darwin\10.1 12\lib\libssl.dylib

                    command='C:\Users\kochi\github\MaplatEditor\node_modules\7zip-bin\win\x64\7za.exe' x -bd 'C:\Users\kochi\AppData\Local\electron-builder\Cache\winCodeSign\618674575.7z' '-oC:\Users\kochi\AppData\Local\electron-builder\Cache\winCodeSign\618674575'
                    workingDir=C:\Users\kochi\AppData\Local\electron-builder\Cache\winCodeSign

Even if I changed the target from NSIS to portable, it was also failed with the same error.

The error says "libssl.dylib" or "Cannot create symbolic link", so I believe it was caused that needless apple resources were extracted in Windows, and failed to create symbolic link on Windows FS.
Are there any fix for this or any work-around?

@Mayconoliveyra
Copy link

Mayconoliveyra commented Mar 28, 2024

This problem is due to privilege.
The solution is simple, just open your project folder in CMD or PowerShell with ADMINISTRATOR privileges.

Ex:
image

@bfurtonmw
Copy link

This error is happening in our CI where running as administrator is not allowed. Is there a workaround for running as an unprivileged user?

@wszgrcy
Copy link

wszgrcy commented Apr 19, 2024

I also encountered this issue and solved it using 'PowerShell with ADMINISTRATOR'
But I didn't see any prompts about building Windows on the official website. Is this the correct operation?

@bfurtonmw
Copy link

bfurtonmw commented Apr 19, 2024

FYI, it seems like it's an issue with the 7zip upgrade under the hood. Workaround: downgrade to electron-builder@24.6.3.

@renkei
Copy link

renkei commented Apr 26, 2024

I've the same issue. There is maybe a better workaround available:

Download the winCodeSign.7z package manually. You can use the same URL as electron-builder is using:
https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z

Then extract the archive to the requested location (I've used 7-Zip 23.01 for Windows) so that you have this folder on your machine:
C:\Users\<YourUserName>\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.6.0\

That's it. I got no errors during extraction. Once the folder exists the download and extraction of the 7z file is skipped during the electron-builder run.

Pro:

  • You don't need admin rights
  • You can use the latest version of electron-builder
  • You need to do this only once as preparation step, also easy to realize in a CI environment

Con

  • You have to do it as long as this issue is not fixed.

@ianoble
Copy link

ianoble commented May 8, 2024

I got 2 errors after extraction:

Cannot create symbolic link : A required privilege is not held by the client. : c:\users[username]\appdata\local\electron-builder\cache\wincodesign\wincodesign-2.6.0\darwin\10.12\lib\libcrypto.dylib
Cannot create symbolic link : A required privilege is not held by the client. : c:\users[username]\appdata\local\electron-builder\cache\wincodesign\wincodesign-2.6.0\darwin\10.12\lib\libssl.dylib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants