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

Cannot build app in non-admin PowerShell session #859

Open
mu88 opened this issue Jun 17, 2024 · 0 comments
Open

Cannot build app in non-admin PowerShell session #859

mu88 opened this issue Jun 17, 2024 · 0 comments
Labels

Comments

@mu88
Copy link

mu88 commented Jun 17, 2024

Problem description

When trying to build an Electron.NET app in a non-admin PowerShell session, it fails when creating a symlink. When doing the same in an admin shell, everything works nicely.

Versions

  • Version: 23.6.2
  • .NET: 8.0.300
  • Node.js: 20.8.1
  • Target: Windows (electronize build /target win)

Steps to Reproduce

  1. Clone this repo: https://github.com/mu88/ElectronWebsiteWrapper
  2. Open non-admin PowerShell
  3. Run dotnet tool restore
  4. Run dotnet electronize build /target win
Logs
Build Electron Application...
Arguments:
      target = win
Build ASP.NET Core App for win-x64...
Executing dotnet publish in this directory: C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\obj\desktop\win
Build ASP.NET Core App for win-x64 under Release-Configuration...
dotnet publish -r win-x64 -c "Release" --output "C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\obj\desktop\win\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained
dotnet publish -r win-x64 -c "Release" --output "C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\obj\desktop\win\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained
Determining projects to restore...
Restored C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\ElectronWebsiteWrapper.csproj (in 1,26 sec).
C:\Program Files\dotnet\sdk\8.0.300\Current\SolutionFile\ImportAfter\Microsoft.NET.Sdk.Solution.targets(36,5): warning NETSDK1194: The "--output" option isn't supported when building a solution. Specifying a solution-level output path results in all projects copying outputs to the same directory, which can lead to inconsistent builds. [C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\ElectronWebsiteWrapper.sln]
ElectronWebsiteWrapper -> C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\bin\Release\net8.0\win-x64\ElectronWebsiteWrapper.dll
ElectronWebsiteWrapper -> C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\obj\desktop\win\bin\


Start npm install...
npm install --production
npm warn config production Use `--omit=dev` instead.

added 48 packages, and audited 49 packages in 14s

found 0 vulnerabilities
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
npm notice To update run: npm install -g [email protected]
npm notice


ElectronHostHook handling started...
Build Electron Desktop Application...
Executing electron magic in this directory: C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\bin\desktop
Create electron-builder configuration file...
node build-helper.js electron.manifest.json


Package Electron App for Platform win...
npx electron-builder --config=./bin/electron-builder.json --win --x64 -c.electronVersion=23.2.0
ÔÇó electron-builder  version=24.13.3 os=10.0.22631
ÔÇó loaded configuration  file=C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\obj\desktop\win\bin\electron-builder.json
ÔÇó description is missed in the package.json  appPackageFile=C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\obj\desktop\win\package.json
ÔÇó packaging       platform=win32 arch=x64 electron=23.2.0 appOutDir=C:\Users\MyUser\Documents\Development\GitHub\ElectronWebsiteWrapper\bin\Desktop\win-unpacked
ÔÇó default Electron icon is used  reason=application icon is not set
ÔÇó 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.306s
Ô¿» 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\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\024984627.7z
  --
  Path = C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\024984627.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:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\024984627\darwin\10.12\lib\libcrypto.dylib
  ERROR: Cannot create symbolic link : A required privilege is not held by the client. : C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\024984627\darwin\10.12\lib\libssl.dylib

                  command='C:\Users\MyUser\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\7zip-bin\win\x64\7za.exe' x -bd 'C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\024984627.7z' '-oC:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\024984627'
                  workingDir=C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign
ÔÇó Above command failed, retrying 3 more times
ÔÇó 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.195s
Ô¿» 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\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\590551711.7z
  --
  Path = C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\590551711.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:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\590551711\darwin\10.12\lib\libcrypto.dylib
  ERROR: Cannot create symbolic link : A required privilege is not held by the client. : C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\590551711\darwin\10.12\lib\libssl.dylib

                  command='C:\Users\MyUser\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\7zip-bin\win\x64\7za.exe' x -bd 'C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\590551711.7z' '-oC:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\590551711'
                  workingDir=C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign
ÔÇó Above command failed, retrying 2 more times
ÔÇó 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.133s
Ô¿» 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\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\214457263.7z
  --
  Path = C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\214457263.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:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\214457263\darwin\10.12\lib\libcrypto.dylib
  ERROR: Cannot create symbolic link : A required privilege is not held by the client. : C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\214457263\darwin\10.12\lib\libssl.dylib

                  command='C:\Users\MyUser\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\7zip-bin\win\x64\7za.exe' x -bd 'C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\214457263.7z' '-oC:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\214457263'
                  workingDir=C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign
ÔÇó Above command failed, retrying 1 more times
ÔÇó 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.121s
Ô¿» 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\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\928637791.7z
  --
  Path = C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\928637791.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:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\928637791\darwin\10.12\lib\libcrypto.dylib
  ERROR: Cannot create symbolic link : A required privilege is not held by the client. : C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\928637791\darwin\10.12\lib\libssl.dylib

                  command='C:\Users\MyUser\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\7zip-bin\win\x64\7za.exe' x -bd 'C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\928637791.7z' '-oC:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign\928637791'
                  workingDir=C:\Users\MyUser\AppData\Local\electron-builder\Cache\winCodeSign
ÔÇó Above command failed, retrying 0 more times


... done
@mu88 mu88 added the bug label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant