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

Setup.exe fails after releasifying. #1485

Closed
flycast opened this issue May 8, 2019 · 14 comments
Closed

Setup.exe fails after releasifying. #1485

flycast opened this issue May 8, 2019 · 14 comments
Labels
bug:failing-test-would-be-nice Issues that would benefit from an automated test to confirm the problem bug:needs-more-information Issues that need more information from the submitter to understand or reproduce the problem

Comments

@flycast
Copy link

flycast commented May 8, 2019

Trying to use Squirrel for the first time. I created a simple install on a simple app of my own using the Getting Started Guide. Everything seems to go well. When I try to run the setup.exe it crashes.

Windows 10 Pro.

Full log file from attempted install:

2019-05-08 09:26:57> Program: Starting Squirrel Updater: --install .
2019-05-08 09:26:57> Program: Starting install, writing to C:\Users\erics\AppData\Local\SquirrelTemp
2019-05-08 09:26:57> Program: About to install to: C:\Users\erics\AppData\Local\SL24DataApp
2019-05-08 09:26:57> Program: Install path C:\Users\erics\AppData\Local\SL24DataApp already exists, burning it to the ground
2019-05-08 09:26:57> CheckForUpdateImpl: Couldn't write out staging user ID, this user probably shouldn't get beta anything: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\erics\AppData\Local\SL24DataApp\packages.betaId'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
at System.IO.File.WriteAllText(String path, String contents, Encoding encoding)
at Squirrel.UpdateManager.CheckForUpdateImpl.getOrCreateStagedUserId()
2019-05-08 09:26:57> CheckForUpdateImpl: Failed to load local releases, starting from scratch: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\erics\AppData\Local\SL24DataApp\packages\RELEASES'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Squirrel.Utility.LoadLocalReleases(String localReleaseFile)
at Squirrel.UpdateManager.CheckForUpdateImpl.d__2.MoveNext()
2019-05-08 09:26:57> CheckForUpdateImpl: Reading RELEASES file from C:\Users\erics\AppData\Local\SquirrelTemp
2019-05-08 09:26:57> CheckForUpdateImpl: First run or local directory is corrupt, starting from scratch
2019-05-08 09:26:57> ApplyReleasesImpl: Writing files to app directory: C:\Users\erics\AppData\Local\SL24DataApp\app-1.0.1
2019-05-08 09:26:57> ApplyReleasesImpl: Squirrel Enabled Apps: []
2019-05-08 09:26:57> ApplyReleasesImpl: No apps are marked as Squirrel-aware! Going to run them all
2019-05-08 09:26:57> ApplyReleasesImpl: Starting fixPinnedExecutables
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: DB Browser for SQLite.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: Entity Developer.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: Excel.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: File Explorer.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: FileZilla.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: GNU Image Manipulation Program.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: Google Chrome.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: Grammarly.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: IrfanView.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: KeePass 2.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: LightTools(64).lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: MeshLab.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: Notepad++.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: PuTTY.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: Search Everything.lnk
2019-05-08 09:26:57> ApplyReleasesImpl: Examining Pin: SOLIDWORKS 2018.lnk
2019-05-08 09:26:58> ApplyReleasesImpl: Examining Pin: Visual Studio 2017.lnk
2019-05-08 09:26:58> ApplyReleasesImpl: Examining Pin: Visual Studio 2019.lnk
2019-05-08 09:26:58> ApplyReleasesImpl: Examining Pin: Word.lnk
2019-05-08 09:26:58> ApplyReleasesImpl: Fixing up tray icons
2019-05-08 09:26:58> ApplyReleasesImpl: cleanDeadVersions: for version 1.0.1
2019-05-08 09:26:58> ApplyReleasesImpl: cleanDeadVersions: exclude folder app-1.0.1

My C:\Users\erics\AppData\Local\SL24DataApp\packages folder has a RELEASES file but not a RELEASES directory.

I have tried running as administrator.

Any help?

@Thieum
Copy link
Contributor

Thieum commented May 8, 2019

@flycast the message Couldn't write out staging user ID, this user probably shouldn't get beta anything could mean at least three things base on the comments in #698 :

  • It could be user rights for read/write access to the local appdata/local folder (unlikely)
  • There is an antivirus that prevents Squirrel to work in the appdata/local folder
  • A previous installation went bad, and Squirrel has a hard time deleting the previous content.

The first things to try would be:

  • to disable the antivirus if any, to see if it changes something
  • to delete the %userprofile%\AppData\Local\SL24DataApp and %userprofile%\AppData\Local\SquirrelTemp and start from scratch, to see if it changes something.

@Thieum
Copy link
Contributor

Thieum commented May 8, 2019

Another possibility from #848 is being on a 32bits OS.

@flycast
Copy link
Author

flycast commented May 9, 2019

OK. Thanks for your prompt response, I REALLY appreciate it. Was was off on another project so I just got back to it. I have rebooted both Visual Studio and the PC and now without changing anything else I am getting a completely different error when releasifying:

Squirrel : System.AggregateException: One or more errors occurred. ---> System.Exception: Failed to link WiX template, command invoked was: 'light.exe -ext WixNetFxExtension -sval -out
"C:\Users\erics\source\repos\SL24 Data App\Releases\Setup.msi" "C:\Users\erics\source\repos\SL24 Data App\Releases\Setup.wixobj"'
At line:1 char:1

  • Squirrel --releasify SL24DataApp.1.0.1.nupkg
  •   + CategoryInfo          : NotSpecified: (System.Aggregat...\Setup.wixobj"':String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    
    

Output was:
Windows Installer XML Toolset Linker version 3.10.0.2103
Copyright (c) Outercurve Foundation. All rights reserved.

light.exe : error LGHT0001 : Access to the path 'C:\Users\erics\source\repos\SL24 Data App\Releases\Setup.msi' is denied.

Exception Type: System.UnauthorizedAccessException

Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes)
at Microsoft.Tools.WindowsInstallerXml.WixBinder.LayoutMedia(ArrayList fileTransfers, Boolean suppressAclReset)
at Microsoft.Tools.WindowsInstallerXml.Binder.BindDatabase(Output output, String databaseFile)
at Microsoft.Tools.WindowsInstallerXml.Binder.Bind(Output output, String file)
at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run(String[] args)
at Squirrel.Update.Program.d__21.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean
generateMsi, String frameworkVersion, Boolean generateDeltas)
at Squirrel.Update.Program.executeCommandLine(String[] args)
at Squirrel.Update.Program.main(String[] args)
at Squirrel.Update.Program.Main(String[] args)
---> (Inner Exception #0) System.Exception: Failed to link WiX template, command invoked was: 'light.exe -ext WixNetFxExtension -sval -out "C:\Users\erics\source\repos\SL24 Data App\Releases\Setup.msi"
"C:\Users\erics\source\repos\SL24 Data App\Releases\Setup.wixobj"'

Output was:
Windows Installer XML Toolset Linker version 3.10.0.2103
Copyright (c) Outercurve Foundation. All rights reserved.

light.exe : error LGHT0001 : Access to the path 'C:\Users\erics\source\repos\SL24 Data App\Releases\Setup.msi' is denied.

Exception Type: System.UnauthorizedAccessException

Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes)
at Microsoft.Tools.WindowsInstallerXml.WixBinder.LayoutMedia(ArrayList fileTransfers, Boolean suppressAclReset)
at Micro
soft.Tools.WindowsInstallerXml.Binder.BindDatabase(Output output, String databaseFile)
at Microsoft.Tools.WindowsInstallerXml.Binder.Bind(Output output, String file)
at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run(String[] args)
at Squirrel.Update.Program.d__21.MoveNext()<---

Confirming, there is in fact no C:\Users\erics\source\repos\SL24 Data App\Releases\Setup.wixobj file in bin/Release.

@flycast
Copy link
Author

flycast commented May 9, 2019

I just cleaned the files out of the folder "Releases" (not bin/Releases) and that took care of the Wix error above. I am now back to the original issue and will troubleshoot.

@flycast
Copy link
Author

flycast commented May 9, 2019

@Thieum - Crud, none of the steps you recommended worked. The OS is 64 bit by the way. I have also verified that the installer is creating a "RELEASE" file and it is readable.

@Thieum
Copy link
Contributor

Thieum commented May 9, 2019

@flycast ok let us know if the hints provided in #1485 (comment) lead you to a resolution, or at least a better understanding of the issue. The exception rised by wix seems to indicate a reading access issue. It might be a red herring, but it's an issue other people had in the past.

@flycast
Copy link
Author

flycast commented May 9, 2019

@Thieum - They did not. That is what I was saying with this comment.

@Thieum
Copy link
Contributor

Thieum commented May 10, 2019

@flycast ah sorry, missed your comment.

@Thieum
Copy link
Contributor

Thieum commented May 10, 2019

@flycast there are two other things I can think of that could be related to read/write rights:

  • UAC could be deactivated, and doesn't play well with your protected folder rights (happened to me with another apps) - try activating it, if it's off, to see if it changes something.
  • The controlled folder access is activated and messes with your access to protected folder, if so, you could try to deactivate it:
    image

@flycast
Copy link
Author

flycast commented May 10, 2019

@Thieum - None of that worked either.

@Thieum
Copy link
Contributor

Thieum commented May 10, 2019

@flycast could you create a repro project without any sensitive information on github so we can try to reproduce the issue?

@shiftkey shiftkey added bug:failing-test-would-be-nice Issues that would benefit from an automated test to confirm the problem bug:needs-more-information Issues that need more information from the submitter to understand or reproduce the problem labels May 12, 2019
@Code-DJ
Copy link

Code-DJ commented May 22, 2019

@flycast just for clarity, what makes you say Setup crashes?

I have the same list of exceptions in log file and yet I don't get any errors (from a UI standpoint) after running setup and am able to launch my app just fine.

@flycast
Copy link
Author

flycast commented May 22, 2019

@Code-DJ - I'm sorry. I switched to Inno because of the time crunch and did get a successful installer built. IF I get a chance I will try to reproduce this issue and post back.

By the way...that Microsoft Defender Controlled Folder Access was interfering with quite a few other things including Visual Studio creating backup files when debugging. It was actually interfering with apps writing to folders inside my Documents folder of the same user that was running the app.

@shiftkey
Copy link
Contributor

IF I get a chance I will try to reproduce this issue and post back.

@flycast I'm going to close this out but please follow up with more details if you are able to reproduce the problem again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:failing-test-would-be-nice Issues that would benefit from an automated test to confirm the problem bug:needs-more-information Issues that need more information from the submitter to understand or reproduce the problem
Projects
None yet
Development

No branches or pull requests

4 participants