You are here

App did not close properly

8 posts / 0 new
Last post
thany
Offline
Last seen: 6 years 9 months ago
Joined: 2011-12-19 05:16
App did not close properly

I'm getting this error message that says my VeraCrypt did not close properly. Every time. It *did* close properly. And even if it didn't, it really isn't a problem at all. And even if it were a problem, you don't have to bother the user with it. Just do that cleanup thing and launch the app right away.

This is the latest VeraCrypt and PA.com 14.1.

With the regular VeraCrypt installed in portable mode (so NOT the PA.com package) I never had any problems anywhere near this kind. It *never* had any problems starting, and I'm not doing anything differently when it comes to how I click on the "dismount all" option and have VC close itself.

Oh and this is the message screenshotted:
https://pbs.twimg.com/media/CnOuGQgW8AAV4zp.jpg:large

John T. Haller
John T. Haller's picture
Online
Last seen: 39 min 15 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Was Still Running

If you closed VeraCrypt but left some drives mounted, then VeraCrypt's service was still running in the background. If VeraCrypt's service is still running, then the VeraCrypt Portable launcher is still running. If you shutdown Windows while this is occurring, VeraCrypt Portable will (correctly) detect that as an improper shutdown because it was unable to move the Configuration.xml, Default Keyfiles.xml, Favorite Volumes.xml, and History.xml from the VeraCryptPortrable\App\VeraCrypt directory back to the VeraCryptPortrable\Data directory because VeraCrypt hadn't closed. If you were to run the PortableApps.com Platform's data backup routine, it would fail to back up VeraCrypt Portable's configuration and key files. If you were to reinstall VeraCrypt Portable in this state, you would lose your configuration and key files. This is will be corrected in the next release of VeraCrypt Portable with custom instructions to the installer to handle an improperly closed app that were inadvertently left off the current release.

The next release of the PortableApps.com Platform will have the ability to tell VeraCrypt to fully exit and unmount all mounted drives as part of the platform close and close all running apps process.

If you prefer not to use the PortableApps.com Platform's close all apps functionality to automatically close your apps safely and alert you of any app that are still running and prefer not to unmount your drives before shutting down Windows, I'd suggest using the standard non-PAF package of VeraCrypt. VeraCrypt Portable's additions are designed to enhance use with the PortableApps.com Platform as VeraCrypt is already portable on its own. The shortcomings you are encountering are due to those necessary additions due to the fact that VeraCrypt does not have a command line or environment variable to redirect settings and configuration to anywhere besides its local folder.

Sometimes, the impossible can become possible, if you're awesome!

thany
Offline
Last seen: 6 years 9 months ago
Joined: 2011-12-19 05:16
Windows will shut down

Windows will shut down programs when it shuts down itself. It does correctly shut down VeraCrypt, otherwise it tells the user about it. Try editing a file in notepad, don't save it, and then shut down Windows. After a while you'll get the message I'm talking about NOT getting. NOT getting that means the shutdown was graceful.

So for all intents and purposes, all programs have shut down gracefully.

Perhaps the bug here is that PA.com (or the launcher) doesn't detect Windows shutdown correctly, since that is in fact a different message from a regular user-iniated shutdown.

To add more proof (as far as I see it), this problem also happens with QuiteRSS, which shuts itself down instantly.
It also happens with FileZilla, which also shuts down instantly.

I think the launcher, or the menu, or something, is bugged.

John T. Haller
John T. Haller's picture
Online
Last seen: 39 min 15 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Must Shutdown In Order

Modern Windows will shut down individual programs without waiting unless each app is correctly configured to trap a Windows shutdown and alert why it will not permit a shutdown. Handling this API is not a simple thing to do within NSIS, the language VeraCryptPortable.exe et al are written in. Windows does not understand multiple-EXE apps in the context of shutting down, so it will unceremoniously kill off VeraCryptPortable.exe before VeraCrypt.exe is closed, so all the data files are left in the wrong location. This is a limitation of the VeraCryptPortable.exe launcher and this message is letting you know of that limitation. It can affect both data backups (missing your data from given apps) and upgrades losing your data (for apps that move data into the App directory and don't have the proper installer.ini directives to instruct the installer to preserve the files if you upgrade after an improper shutdown without running the app again to clean up).

Even if we were to solve the issue for the launcher and have the proper code to have them accept the message from Windows and properly respond, we would need to then update the launchers for all 300+ apps to have them all handling it.

Please use the PortableApps.com Platform's shutdown facility to automatically closed the base apps before the portable launchers. If you are unwilling to do so in the case for VeraCrypt, please use the standard package from the zip. While unfortunate, this is the way things are setup at present. And we don't currently have the resources to hack a workaround into NSIS to handle this or rewrite the portable launcher in another language.

Sometimes, the impossible can become possible, if you're awesome!

thany
Offline
Last seen: 6 years 9 months ago
Joined: 2011-12-19 05:16
Thanks for explaining. So

Thanks for explaining. So there's no workaround while keeping the PA package for VeraCrypt and others? I don't prefer using the default zip package, because I would be missing out on auto-updates from PA. Some apps notify about updates, but so far none of my apps update themselves, let alone updating all with one tool.

So and, by "shutdown facility" you mean the option "close apps on platform exit"?

vin100
Offline
Last seen: 8 years 3 months ago
Joined: 2016-08-25 04:39
Same error with Telegram

I've the same error with Telegram

ottosykora
Offline
Last seen: 18 hours 48 min ago
Joined: 2007-10-11 17:48
just shut down

prior shutting down windows, thats all needed

Otto Sykora
Basel, Switzerland

toolazy666
Offline
Last seen: 8 years 1 month ago
Joined: 2016-10-17 14:38
My Solution

I'm having this issue with PortableFreeDownloadManager/uTorrent/qBitorrent...etc, I'm using them on a headless download server and my area suffers from frequent powerouts, now I know the whole discussion about "proper shutdowns" and "lost data" (I've read the entire other locked thread) ...etc, but I needed a solution and I'm willing to accept the results, so here's what I did :

I've created a .bat file with the following code (this is for FreeDownloadManager but can be adapted to include many other apps, and even used to create a custom launcher for your portable app, also I didn't use the /F switch for taskkill because then you'll get the same unclean shutdown error again) :

@@echo off
taskkill /IM FreeDownloadManagerPortable.exe
TIMEOUT /T 10
start D:\portables\FreeDownloadManagerPortable\FreeDownloadManagerPortable.exe
@exit

next, I used an app called "startup delayer" to control how my apps are launched on startup, first portable FreeDownloadManager is launched and the error message shows up, then 5 seconds later the script is executed, the error window is closed and FDM is relaunched again, of course instead of using "startup delayer" you can use the windows task scheduler to run the script, it should work too.

I hope this will help someone, it works for me and my apps are running on startup again.

Log in or register to post comments