For all of those who are constantly on the move, it might be interesting to have all your applications and data on a USB Flash Drive.
This lets you avoid moving around with a laptop, and run the application from any computer.
With WinDev, it's extremely easy to deploy an application and its data on a USB flash drive, in other words, to create an application that you can run directly from the USB flash drive.
PrincipleIn fact, it's very simple!
You develop an application with WinDev, just as you usually do.
When you create the .exe, all you have to do is chose to include the .dlls in your executable.
Next you can copy the executable and the data on a USB flash drive.
That's it.
Some precautionsKeeping in mind that the USB flash drive can be removed from the computer at all times, some precautions have to be taken with your applications.
For instance, if the user removes the flash drive, he should be informed that the application is still running, to avoid any data loss.
There's a function in WLanguage that informs you when a USB flash drive is plugged in or disconnected (fDetectRemovableStorage).
We can now check the action performed on the USB flash drive and if it's been removed, you can display a message asking the user to reinsert the flash drive, or the application is closed.
Second precaution, to ensure the integrity of your database on the USB flash drive, we advice you touse the WLanguage function, HSecurity with “2” as a parameter.
This function forces a physical write on the flash drive without having to pass through Windows' cache memory.
One last thing - If you have to save parameters, don't use the registry. They'd be lost when you change computers. You should rather use a .ini or an XML file. To do this you can use the WLanguage functions InitParameter , SaveParameter, LoadParameter).
- Use relative paths in your applications. The fact is that the flash drive isn't always on the same drive.
That's it, with just some tips your ready!