HubTurbo / addressbook

A small app for training and experimentation
Other
1 stars 3 forks source link

Main application should upgrade both the updater and the launcher #532

Closed m133225 closed 8 years ago

m133225 commented 8 years ago

Currently, only updater is upgraded by the main application. When the application is started again by the launcher, it will be unable to upgrade itself to the newer version.

In addition, older versions of resource jar and launcher jar are not being removed.

damithc commented 8 years ago

I think Hans mentioned that in Windows you cannot delete another jar file that was involved in the launch chain. e.g. as the launcher is the one that launches the main app, the main app cannot delete the launcher. That's why we decided that upgrades to launcher cannot be done automatically.

m133225 commented 8 years ago

I don't think that's the case here, the launcher lauches the app and explicitly closes after doing so.

damithc commented 8 years ago

I'm guessing in Windows, as long as the child process is live, any resources held by the parent process remain locked, or something like that. @HansNewbie any input?

damithc commented 8 years ago

BTW, I also noticed that I cannot delete the log folder even if the app is no longer running. That means a process launched by the app is still alive and keeping a lock on the folder?

HansNewbie commented 8 years ago

In the case of launcher, it should not be parent and child process. It's just one process creating another process since they don't keep a reference to each other (as Martin said, the launcher closes after invokig the main app).

I am guessing the problem is we are not quitting the app (or yhe launcher) properly. Aa in we need to call System.exit() and Platform.stop() (or something similar, can't remember the exact method name), in the correct order, and also overridig the JavaFX stop call.

damithc commented 8 years ago

Ignore my comment about log folder. Turns out the log file was open in notepad. It allowed me to delete the file, not not the folder :-p