Delete working directory during installing.

35 views
Skip to first unread message

Sean Clancy

unread,
Jun 13, 2025, 7:05:57 AM6/13/25
to innosetup
I have an app that I deploy using innosetup.  It works great and installs my app and it's mass of needed files into Appdata>Roaming>Guitar SightReader Toolbox.
This works great when I do this when there is no Guitar SightReader Toolbox directory.

However, time to time I need the user to do a full reinstall (for framework changes).
I need this install to delete the Guitar SightReader Toolbox directory before reinstalling it.

Is there a one or more line of code that will do this?

note:  My app is actually located in a folder in Roaming>Guitar SightReader Toolbox
I program in Xojo.  If you want to see my software website...www.guitar-sightreader.com

Gavin Lambert

unread,
Jun 15, 2025, 7:08:07 PM6/15/25
to innosetup
On Friday, June 13, 2025 at 11:05:57 PM UTC+12 Sean Clancy wrote:
I have an app that I deploy using innosetup.  It works great and installs my app and it's mass of needed files into Appdata>Roaming>Guitar SightReader Toolbox.
This works great when I do this when there is no Guitar SightReader Toolbox directory.

However, time to time I need the user to do a full reinstall (for framework changes).
I need this install to delete the Guitar SightReader Toolbox directory before reinstalling it.

You can use the [InstallDelete] section to delete files and folders prior to installation/upgrade.  However bear in mind that this is strongly discouraged to delete entire folders that might contain user-specific files (even if you didn't put them there, the user might).  It's better to delete specific individual files that you know are now redundant and causing problems, or even to leave the files behind if they're redundant but not actually causing any problems.

Also note that if you're using the default PrivilegesRequired=admin setting you should not be installing anything at all into {userappdata} as part of the installer -- your application itself (installed to a subdir of {pf}) should be doing that.  And if you're using PrivilegesRequired=lowest, then while you can install files to {userappdata}, the actual application is supposed to be installed to a subdir of {userpf}.
Reply all
Reply to author
Forward
0 new messages