When I compile my app in visual studio 2012 RC, I can see a bin\
folder generated in the project source folder as expected, in which there is a foo.exe, looks like the entry of the app. When I start debugging the app, its icon is put on the start screen and I can find a new folder created at
C:\Users\someone\AppData\Local\Packages\xxxxx_xxxxxx
But I can't find foo.exe in this folder, even after I searched the whole disk. It seems the win8 application has a different installation/deployment mechanism than old windows programs. My questions are:
(1) how/where the win8 app is deployed/installed?
(2) I want to use \AppData\Local\Packages\xxxxx_xxxxxx\LocalState
as a local data folder(which equals to ApplicationData.Current.LocalFolder
in the code), but the whole folder is deleted when right click the start screen icon and press "uninstall", without any warning. Any better place to store local data? Or I need SQLite? For example, my app writes all crash messages in error.txt
, obviously I can't use sqlite in this case, and if I put error.txt
in LocalState folder, users may already uninstalled the app, before I go to him to see what's in error.txt
. Another scenario is: a user want to uninstall the app, but keep his local data(files). Obviously ApplicationData.Current.LocalFolder is not a good choice.
App Installer allows Windows 10 apps to be installed by double-clicking the app package. This means that users don't need to use PowerShell or other developer tools to deploy Windows 10 apps. The App Installer can also install an app from the web, optional packages, and related sets.
1) The Windows 8 packages are deployed to c:\Program Files\windowsapps\, but by default you don't have ownership of that folder and so can't access it. That's largely irrelevant, though. You should never have access to this folder by design.
2) Again, deleting the local data folders for an app on uninstall is expected behaviour. Otherwise, if you deployed an app via the store and it started to misbehave and took up all of your available storage, there'd be no simple way for a user to delete that data. Your assertion that there is no warning is not true, however. The uninstall popup clearly says "This app and its related info will be removed from this PC"
In some instances, storing data in the roaming folder may be an option, but this folder is not intended ofr large amounts of data - it's there to hold application settings / config options to roam between devices. You could probably put your crash log in there during dev (if it is small enough), but there is no guarantee that it will be synced to the cloud before the app gets uninstalled. Your best bet would probably be to use the Live SDK to sync data to the cloud, but again, you have no guarantee that data will be written instantly to the cloud.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With