Air, how to remove folder on uninstall?
I have an Air app that was published 开发者_Python百科as a native installer. If the user uninstalls the program it doesn't remove the folder that it was installed in. Then when the user tries to install again, it will throw an error saying that folder already exists.
ie if the program is C:/program files/my app/{contents here} it removes the {contents here} but leaves the /my app directory.
Is there a way to make sure that folder is removed at uninstall time?
I don't think there's a way of forcing the uninstaller to delete the folder, but the reason it's not deleted is because it contains files that were not put there by the original installation. If, for exemple, you saved user profiles in your installation folder hierarchy, it won't be deleted.
You can't make sure the user won't put any files there, but at least you can avoid writing any file/folder in your installation folder from your app. Instead, use application storage folder (File.applicationStorageDirectory). You can also easily create new folders there with File.applicationStorageDirectory.resolvePath("exemple");
精彩评论