Should Inno Setup delete old files on Update?

Hannes

I'm using Inno Setup to install and update my python application.

On update the installer does not delete py files from the previous installation which creates two problems:

  • I'm using plugins: If I delete a plugin in a new version, it is still there for users who performed an update.

  • When uninstalling an updated installation, files from the old installations will not be removed. (Cannot reproduce...)

How can I force Inno Setup to uninstall my application before upgrading?

Here is my Script:

[Setup]
AppName=Foo
AppVersion=0.1
PrivilegesRequired=lowest
AppId=FooID
RestartIfNeededByRun=False
DefaultDirName={localappdata}\Foo
DisableWelcomePage=True
DisableReadyPage=True
OutputDir=.\win
OutputBaseFilename=setup_Foo
AllowNoIcons=yes
DefaultGroupName=Foo

[Files]
Source: "dist\Foo.exe"; DestDir: "{app}"
Source: "..\*"; DestDir: "{app}\"; Flags: recursesubdirs; Excludes: "*.pyc,installer"

[Icons]
Name: "{group}\Foo"; Filename: "{app}\Foo.exe"; WorkingDir: "{app}"
Name: "{group}\Uninstall Foo"; Filename: "{uninstallexe}"

[Dirs]
Name: "{app}\plugins"

[Run]
Filename: "{app}\Foo.exe"; WorkingDir: "{app}"; Flags: nowait postinstall
Miral

While it's possible to run the uninstall prior to an upgrade, it is not recommended.

Instead you should use [InstallDelete] entries to remove the specific files that are now redundant. You should know which files these are.

[InstallDelete]
Type: files; Name: {app}\foo.bar
Type: files; Name: {app}\baz\quux.txt

While it is possible to use wildcards, this is not recommended (especially not wildcards that ignore file extensions) as it may unintentionally delete user files, especially if {app} is somewhere unexpected (perhaps they installed directly into their Windows folder).

As for your second assertion, that "When uninstalling an updated installation, files from the old installations will not be removed.", this is simply untrue. As long as you keep the AppId and destination folder the same, then uninstalling will uninstall all previously installed files even after an update. You should use the following setting to help ensure this:

[Setup]
DisableDirPage=auto

Additionally, provided that you have not yet released this application you should consider changing its DefaultDirName to {userpf}\YourAppName instead; this is a better location to install per-user applications. (If you have already released the app, it's still safe to change this value provided that you don't change the AppId, but you'll have to bear in mind that older installations will remain at the older path.)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Should Inno Setup delete old files on Update?

From Dev

Inno Setup – zip local files prior to an update

From Dev

Inno Setup - install files based on feature and automatic update

From Dev

Automatic update of Inno Setup program

From Dev

Copying hidden files in Inno Setup

From Dev

What should be done to copy files from installed directory to another after installation complete using inno setup script?

From Dev

How to delete a nonempty folder in inno setup

From Dev

Inno Setup: Delete folder with Task function

From Dev

inno setup - Delete arbitrary substring from a string

From Dev

Powershell - delete old folders but not old files

From Dev

Signing files using Inno Setup with the signonce flag

From Dev

How to support thousands of files using Inno Setup?

From Dev

Sign all exe files on Inno Setup Installation

From Dev

Prevent Inno Setup deleting some files on uninstall

From Dev

Inno Setup refuses to set permissions of some files

From Dev

Create ZIP files from within Inno Setup

From Dev

Compile Inno Setup script (.iss files) with Maven?

From Dev

How to find an unique name to rename/archive old directories in Inno Setup

From Dev

Camel route to delete old files

From Dev

Why is setup.py installing old files?

From Dev

Inno setup throws error "No Files Found Matching" Even tough files are there

From Dev

Inno Setup [UninstallDelete] delete all except one folder

From Dev

Inno Setup: Delete empty lines from test file

From Dev

Inno setup uninstaller doesnt delete rewritten registry values

From Dev

Update Trigger how to delete old record

From Dev

Inno Setup - How to Install Windows Update Offline Installer

From Dev

inno-setup update file in all subdirectories where it exists

From Dev

Inno Setup: Custom page to select Update or Remove/Uninstall

From Dev

Powershell script does not delete old files

Related Related

  1. 1

    Should Inno Setup delete old files on Update?

  2. 2

    Inno Setup – zip local files prior to an update

  3. 3

    Inno Setup - install files based on feature and automatic update

  4. 4

    Automatic update of Inno Setup program

  5. 5

    Copying hidden files in Inno Setup

  6. 6

    What should be done to copy files from installed directory to another after installation complete using inno setup script?

  7. 7

    How to delete a nonempty folder in inno setup

  8. 8

    Inno Setup: Delete folder with Task function

  9. 9

    inno setup - Delete arbitrary substring from a string

  10. 10

    Powershell - delete old folders but not old files

  11. 11

    Signing files using Inno Setup with the signonce flag

  12. 12

    How to support thousands of files using Inno Setup?

  13. 13

    Sign all exe files on Inno Setup Installation

  14. 14

    Prevent Inno Setup deleting some files on uninstall

  15. 15

    Inno Setup refuses to set permissions of some files

  16. 16

    Create ZIP files from within Inno Setup

  17. 17

    Compile Inno Setup script (.iss files) with Maven?

  18. 18

    How to find an unique name to rename/archive old directories in Inno Setup

  19. 19

    Camel route to delete old files

  20. 20

    Why is setup.py installing old files?

  21. 21

    Inno setup throws error "No Files Found Matching" Even tough files are there

  22. 22

    Inno Setup [UninstallDelete] delete all except one folder

  23. 23

    Inno Setup: Delete empty lines from test file

  24. 24

    Inno setup uninstaller doesnt delete rewritten registry values

  25. 25

    Update Trigger how to delete old record

  26. 26

    Inno Setup - How to Install Windows Update Offline Installer

  27. 27

    inno-setup update file in all subdirectories where it exists

  28. 28

    Inno Setup: Custom page to select Update or Remove/Uninstall

  29. 29

    Powershell script does not delete old files

HotTag

Archive