Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Fail on clean, first install -> (must be installed first) #84

Closed
Arvidas opened this issue May 31, 2022 · 5 comments
Closed

Fail on clean, first install -> (must be installed first) #84

Arvidas opened this issue May 31, 2022 · 5 comments
Labels
bug Something isn't working os:windows

Comments

@Arvidas
Copy link

Arvidas commented May 31, 2022

v3

2022-05-31 11:27:43.3066 [INFO] - Program: Starting Squirrel Updater: --setup C:\Users\Kasutaja\source\repos\WebRoot\bin\Debug\net6.0\wwwroot-custom\updates\WPFAppFrameworkSetup.exe --setupOffset 181760
2022-05-31 11:27:43.3984 [INFO] - Program: Updater location is: C:\Users\Kasutaja\AppData\Local\Temp\squB9A0.tmp.exe
2022-05-31 11:27:43.3984 [INFO] - Program: Extracting bundled app data from 'C:\Users\Kasutaja\source\repos\WebRoot\bin\Debug\net6.0\wwwroot-custom\updates\WPFAppFrameworkSetup.exe'.
2022-05-31 11:27:43.5918 [INFO] - Program: Starting package install from directory C:\Users\Kasutaja\AppData\Local\Temp\Clowd.Squirrel\temp.1
2022-05-31 11:27:43.7318 [INFO] - Program: Starting install, writing to C:\Users\Kasutaja\AppData\Local\Temp\Clowd.Squirrel\temp.1
2022-05-31 11:27:43.8066 [INFO] - Program: About to install to: C:\Users\Kasutaja\AppData\Local\WPFAppFramework
2022-05-31 11:27:43.8066 [WARN] - Program: Install path C:\Users\Kasutaja\AppData\Local\WPFAppFramework already exists, burning it to the ground
2022-05-31 11:27:43.8066 [INFO] - PlatformUtil: Killing all processes in C:\Users\Kasutaja\AppData\Local\WPFAppFramework
2022-05-31 11:27:43.8346 [INFO] - PlatformUtil: Terminated 0 processes successfully.
2022-05-31 11:27:44.4755 [FATAL] - Program: Encountered fatal unhandled exception.: System.AggregateException: One or more errors occurred. (Cannot perform this operation in a portable app (must be installed first).)
---> System.InvalidOperationException: Cannot perform this operation in a portable app (must be installed first).
at Squirrel.UpdateManager.acquireUpdateLock() in ./Squirrel/UpdateManager.cs:line 226
at Squirrel.UpdateManager.CheckForUpdate(Boolean ignoreDeltaUpdates, Action1 progress, UpdaterIntention intention) in ./Squirrel/UpdateManager.CheckForUpdates.cs:line 21 at Squirrel.UpdateManager.FullInstall(Boolean silentInstall, Action1 progress) in ./Squirrel/UpdateManager.cs:line 92
at Squirrel.Update.Program.Install(Boolean silentInstall, ProgressSource progressSource, String sourceDirectory) in ./Update.Windows/Program.cs:line 280
at Squirrel.Update.Program.Setup(String setupPath, Int64 setupBundleOffset, Boolean silentInstall, Boolean checkInstall) in ./Update.Windows/Program.cs:line 226
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean )
at System.Threading.Tasks.Task.Wait(Int32 , CancellationToken )
at System.Threading.Tasks.Task.Wait()
at Squirrel.Update.Program.executeCommandLine(String[] args) in ./Update.Windows/Program.cs:line 83
2022-05-31 11:27:46.0659 [INFO] - Program: Finished Squirrel Updater

Does it make sense?
private Task acquireUpdateLock()
{
if (!ModeDetector.InUnitTestRunner() && _config.CurrentlyInstalledVersion == null)
throw new InvalidOperationException("Cannot perform this operation in a portable app (must be installed first).");

If I create filled "sq.version" file in "%localappdata%\WPFAppFramework\current" folder then it installs.

@Arvidas Arvidas changed the title First install -> (must be installed first) Fail on clean, first install -> (must be installed first) May 31, 2022
@caesay caesay added the bug Something isn't working label May 31, 2022
@caesay
Copy link
Member

caesay commented May 31, 2022

This is indeed a bug, thanks for reporting this.

@caesay
Copy link
Member

caesay commented Jun 8, 2022

Closed by 878fb99

@caesay caesay closed this as completed Jun 8, 2022
@nazar322
Copy link

Having the same exception using CheckForUpdate method.
Clean install, running from the Visual Studio. The latest version from the develop branch as of today.
Cannot perform this operation in a portable app (must be installed first).
at Squirrel.UpdateManager.acquireUpdateLock() at Squirrel.UpdateManager.<CheckForUpdate>d__9.MoveNext()

To overcome it I actually packed the app and installed it, then copied Update.exe from the ...AppData\Local\AppId folder into the bin folder (above Debug folder where from my executable executed). It didn't help.
How can I debug Squirrel integration from Visual Studio?

@caesay
Copy link
Member

caesay commented Feb 15, 2023

The hint is in your error message and your problem is not the same as this issue.

Cannot perform this operation in a portable app (must be installed first).

Means that your app must actually be installed to CheckForUpdate.

@nazar322
Copy link

How can one debug it from the VS then?
I installed the app after like I mentioned and still I get this error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working os:windows
Projects
None yet
Development

No branches or pull requests

3 participants