I'm packaging my app with B4JPackager11 & Inno Setup as described at https://www.b4x.com/android/forum/t...the-simplest-way-to-distribute-ui-apps.99835/.
My app creates a number of temporary files during use (e.g. user settings, temporary png files etc), These are written to File.DirData.
To keep things tidy, I'm trying to use the Inno Setup [UninstallDelete] section to remove the settings & temp files when the app is uninstalled (http://www.jrsoftware.org/ishelp/ - 'Setup Script Sections'>[UninstallDelete] section).
So, I have;
in my Inno Setup script.
{userappdata} is listed as a constant in the Inno Setup help docs and {userappdata}\MyApp\ seems to be equivalent to File.DirData.
BUT, I get a warning when compiling the Inno Setup script;
Which makes perfect sense; the admin user running the uninstall won't necessarily be the user of the app, so during the uninstall {userappdata} may not point to the correct user folder.
I want the user to be able to install to the C:\Program Files\ folder, so I think the install/uninstall will have to be done with admin privileges.
My app has to be able to write the settings & temp files even if the user is non-admin, hence I'm using File.DirData (which points to the C:\Users\[user name]\AppData\Roaming\[AppName] folder). I think using File.DirTemp still uses the C:\Users\[user name]\.... folder so would have the same problem.
I have also thought of deleting the temp files each time the app is closed, but I don't want to do that with the saved user settings.
Can anyone think of a way to delete the settings & temp files when the app is uninstalled?
My app creates a number of temporary files during use (e.g. user settings, temporary png files etc), These are written to File.DirData.
To keep things tidy, I'm trying to use the Inno Setup [UninstallDelete] section to remove the settings & temp files when the app is uninstalled (http://www.jrsoftware.org/ishelp/ - 'Setup Script Sections'>[UninstallDelete] section).
So, I have;
B4X:
[UninstallDelete]
Type: files; Name: "{userappdata}\MyApp\*.png"
Type: files; Name: "{userappdata}\MyApp\settings"
Type: dirifempty; Name: "{userappdata}\MyApp"
{userappdata} is listed as a constant in the Inno Setup help docs and {userappdata}\MyApp\ seems to be equivalent to File.DirData.
BUT, I get a warning when compiling the Inno Setup script;
B4X:
Warning: The [Setup] section directive "PrivilegesRequired" is set to "admin" but per-user areas (userappdata) are used by the script.
Regardless of the version of Windows, if the installation is running in administrative install mode then you should be careful about
making any per-user area changes: such changes may not achieve what you are intending. See the "UsedUserAreasWarning" topic in help file for more information.
I want the user to be able to install to the C:\Program Files\ folder, so I think the install/uninstall will have to be done with admin privileges.
My app has to be able to write the settings & temp files even if the user is non-admin, hence I'm using File.DirData (which points to the C:\Users\[user name]\AppData\Roaming\[AppName] folder). I think using File.DirTemp still uses the C:\Users\[user name]\.... folder so would have the same problem.
I have also thought of deleting the temp files each time the app is closed, but I don't want to do that with the saved user settings.
Can anyone think of a way to delete the settings & temp files when the app is uninstalled?