electron-wix-msi icon indicating copy to clipboard operation
electron-wix-msi copied to clipboard

AutoUpdater is not working if the defaultInstallMode is perUser

Open aestenfe opened this issue 3 years ago • 4 comments

My goal is to create an wix-msi installer which need no admin permission and includes autoUpdates.

As long as I don't set the defaultInstallMode: 'perUser', the autoUpdater is working. But when I set the defaultInstallMode, the autoUpdater can't find the update file:

[23/12/20 16:32:01] info: Program:  MSQ Updater: --checkForUpdate http://localhost:3100/update/1.0.0
[23/12/20 16:32:01] info: Utility: IsAutoUpdateEnabled: AutoUpdate key does not exist. AutoUpdating disabled.
[23/12/20 16:32:01] info: Program: Fetching update information, downloading from http://localhost:3100/update/1.0.0
[23/12/20 16:32:01] info: CheckForUpdateImpl: Generated new staging user ID: a09d1337-c74d-52d7-8226-d1fb2f9a05f5
[23/12/20 16:32:01] info: CheckForUpdateImpl: Downloading RELEASES file from http://localhost:3100/update/1.0.0
[23/12/20 16:32:01] info: FileDownloader: Downloading url: http://localhost:3100/update/1.0.0/RELEASES
[23/12/20 16:32:02] warn: CheckForUpdateImpl: No local releases found, starting from scratch
[23/12/20 16:32:02] warn: UpdateInfo: Couldn't get release notes for:test-1.0.3-full.nupkg: System.IO.FileNotFoundException: Could not find file 'C:\Users\user\AppData\Local\Programs\test\packages\test-1.0.3-full.nupkg'.
File name: 'C:\Users\user\AppData\Local\Programs\test\packages\test-1.0.3-full.nupkg'
   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 NuGet.ZipPackage.<>c__DisplayClass9_0.<.ctor>b__0()
   at NuGet.ZipPackage.EnsureManifest()
   at Squirrel.ReleaseEntry.GetReleaseNotes(String packageDirectory)
   at Squirrel.UpdateInfo.<FetchReleaseNotes>b__19_0(ReleaseEntry x)
[23/12/20 16:32:02] info: Program: ensureCurrentVersion: No locally installed release package found. This is likely the first update of an MSI install. Looking for latest version via App folder name.
[23/12/20 16:32:02] info: Program: Finished Squirrel Updater

Here is my MSICreator:

const msiCreator = new msi.MSICreator({
  appDirectory: path.join(__dirname, '../out/test-win32-x64'),
  exe: 'test',
  name: 'test',
  version: '1.0.2',
  outputDirectory: path.join(__dirname, '../out/releases/'),
  ui: {
    chooseDirectory: true,
  },
  features: {
    autoUpdate: true,
  },
  defaultInstallMode: 'perUser',
  updaterPermissions: true,
});

Is there a way to realize the goal?

aestenfe avatar Dec 23 '20 21:12 aestenfe

Side note : defaultInstallMode is not referenced/documented in the README

flavienbwk avatar Feb 12 '21 09:02 flavienbwk

fixed in my branch https://github.com/SharpDevSa/electron-wix-msi

SharpDevSa avatar May 04 '21 13:05 SharpDevSa

@aestenfe @flavienbwk How to test the autoUpdate. I am new to this. I can't able to find any documentation/examples to add/test auto updates. and how to see the logs above one ? can you please help me on this.

Rambarani avatar May 14 '22 13:05 Rambarani

@aestenfe @SharpDevSa Did you used electron-packager or electron builder to feed to this '../out/test-win32-x64'

I used electron builder. After running MSI creator, it does not creating RELEASE File, or nupkg file.

It created only .msi .wix.obj .wix.pdb wxs

I am using also same code msi creator code above

How can i achieve auto updates ? Please help me on this !

[17-05-22 08:30:28] info: Program: MSQ Updater: --checkForUpdate https://.s3.amazonaws.com [17-05-22 08:30:28] info: Utility: IsAutoUpdateEnabled: AutoUpdate key exists and is 1. AutoUpdating enabled. [17-05-22 08:30:28] info: Program: Fetching update information, downloading from https://.s3.amazonaws.com [17-05-22 08:30:28] info: CheckForUpdateImpl: Generated new staging user ID: 3d99a132-49a9-5958-84b6-a5abbb4663b5 [17-05-22 08:30:28] info: CheckForUpdateImpl: Downloading RELEASES file from https://.s3.amazonaws.com [17-05-22 08:30:28] info: FileDownloader: Downloading url: https://.s3.amazonaws.com/RELEASES [17-05-22 08:30:29] warn: IEnableLogger: Failed to download url: https://.s3.amazonaws.com/RELEASES: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result) at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Squirrel.Utility.<LogIfThrows>d__43`1.MoveNext() [17-05-22 08:30:29] info: FileDownloader: Downloading url: https://.s3.amazonaws.com/releases [17-05-22 08:30:30] warn: IEnableLogger: Failed to download url: https://*******.s3.amazonaws.com/releases: System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result) at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

Rambarani avatar May 16 '22 17:05 Rambarani