I’m developing an Electron.js app and trying to build it using electron-builder. The build process fails with the following error related to symbolic links:
Scanning the drive for archives:
1 file, 5635384 bytes (5504 KiB)
Extracting archive: C:UsersLenovoAppDataLocalelectron-builderCachewinCodeSign496893375.7z
--
Path = C:UsersLenovoAppDataLocalelectron-builderCachewinCodeSign496893375.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 : A required privilege is not held by the client. : C:UsersLenovoAppDataLocalelectron-builderCachewinCodeSign496893375darwin10.12liblibcrypto.dylib
ERROR: Cannot create symbolic link : A required privilege is not held by the client. : C:UsersLenovoAppDataLocalelectron-builderCachewinCodeSign496893375darwin10.12liblibssl.dylib
command='C:techstoneelectronjsparts-appnode_modules7zip-binwinx647za.exe' x -bd 'C:UsersLenovoAppDataLocalelectron-builderCachewinCodeSign496893375.7z' '-oC:UsersLenovoAppDataLocalelectron-builderCachewinCodeSign496893375'
workingDir=C:UsersLenovoAppDataLocalelectron-builderCachewinCodeSign
• Above command failed, retrying 0 more times
Project Information:
Electron: ^31.3.0
Electron-builder: ^24.13.3
OS: Windows 10 (also testing on Windows 11)
Node.js version: 16.x
package.json:
{
"name": "parts-app",
"version": "0.1.0",
"private": true,
"main": "main/electron.js",
"homepage": ".",
"dependencies": { ... },
"scripts": {
"start": "concurrently "npm run start-react" "npm run start-electron"",
"build": "react-scripts build && electron-builder",
"postinstall": "electron-builder install-app-deps",
},
"build": {
"appId": "com.parts-app",
"directories": {
"output": "dist"
},
"win": {
"target": [
"nsis",
"portable"
]
}
}
}
I’ve checked a few articles online, and many suggest enabling Developer Mode on Windows to bypass the symbolic link privilege issue. However, my main goal is to code sign the app, and I’m not sure how enabling Developer Mode would help with this process.
I’ve tried running the build with administrator privileges (Run as Administrator), but the issue persists.
I’m not clear on how to proceed, and I’m unsure why macOS-specific files (libcrypto.dylib and libssl.dylib) are being handled during a Windows build. I need help understanding what steps to take for proper code signing.
My Questions:
How can I prevent these macOS-related files from being handled during the Windows build process?
Is there a better approach to resolve the symbolic link error, especially for Windows builds?