You are here

Move file/dir

3 posts / 0 new
Last post
Pico1965
Offline
Last seen: 1 year 3 months ago
Joined: 2006-06-06 12:08
Move file/dir

Sorry for the stupid question but i'm developing my first portableapps.

My app need to move a dir and a file:

[Environment]
FullAppDir=%PAL:AppDir%\TeraCopy

[FilesMove]
Settings\Options.ini= %FullAppDir%
[DirectoriesMove]
Settings\Teracopy=%APPDATA%\Teracopy

All is OK.

At the start of program file and dir are moved as expected.
At the end of program file and dir return to their place.

When the application start the file and the folder are REMOVED from %PAL:AppDir%\Setting.
If during application works PC crash, USB problem, blackout etc i lose the data and the application would stop functioning without manually work of data recovering.

How can I avoid losing data?

Thanks for your attention.

JLim
Offline
Last seen: 4 months 4 weeks ago
Joined: 2013-07-17 01:30
The PAL has already consider

The PAL has already consider the abnormal exit problem.
I think your code have some error.
As far as I know, the environment path variable "FullAppDir" should be set in custom code not in Environment section. And also needed only if you are making a 32+64 bit application, otherwise this variable is not needed.

I suggest you to change the code as follow:

[FilesMove]
Settings\Options.ini=%PAL:AppDir%\TeraCopy

[DirectoriesMove]
Settings\Teracopy=%APPDATA%\Teracopy

Pico1965
Offline
Last seen: 1 year 3 months ago
Joined: 2006-06-06 12:08
The PAL has already consider

The PAL has already consider the abnormal exit problem.

Thanks for your answer!

As far as I know, the environment path variable "FullAppDir" should be set in custom code not in Environment section.

I would not want to appear presumptuous after I said a novice.
Here https://portableapps.com/manuals/PortableApps.comLauncher/ref/launcher.i... there is the example
APPNAME_HOME=%PAL:DataDir%\settings

The variable was created for ease of development or, if you prefer, for simplicity.
Maybe in this application it may seem excessive but other more complex can be useful.

Today is a holiday in Italy (called ferragosto).
Good day for all

Log in or register to post comments