3
votes

So, I just picked up Inno today, to try and get a basic installer for a Unity game. The installer portion of Inno works perfectly, unfortunately, the uninstaller doesn't work at all. I've gone through the docs, and trawled Google, and haven't seen much on this exact problem. The Inno docs recommend using the [UninstallDelete] section, which I've tried, with similar results.

[Setup]
AppName=Installable Files
AppVersion=1.0
DefaultDirName={pf}\Installable Files
DefaultGroupName=Installable Files                              
UninstallDisplayIcon={app}\File.exe
Compression=lzma2
UninstallFilesDir={app}\uninst
SolidCompression=yes

[Files]
Source: "File.exe"; DestDir: "{app}"; DestName: "File.exe"
Source: "Files\*"; DestDir: "{app}\Files"; Flags: recursesubdirs
Source: "Files\README.txt"; DestDir: "{app}"; Flags: isreadme

[Icons]
Name: "{group}\Files"; Filename: "{app}\File.exe"; WorkingDir: "{app}"

[UninstallDelete]
Type: filesandordirs; Name: "{pf}\Files" 

The output from the above code says it's deleting all the files in the subdirs, but fails to delete the directory w/ (145) error code, and then states the unistallation process succeeded. This is the same whether I run the uninstaller from the Inno Setup Compiler, the uninst000.exe, or from the Add/Remove Programs in Windows.

An installer/uninstaller that doesn't actually uninstall anything is annoying, so if there's any insight into this problem that'd be great.

(Please note I've also tried deleting individual files under [UninstallDelete] such as Type: files; Name: "{app}\LGODemo.exe" with zero success)

EDIT: After Install

After Uninstall

As the images show, none of the files get deleted, due to a 145 error. The uninstaller then tries again, and apparently deletes the folders, except they still exist, and the file is still 100% executable. I only added the UninstallDelete section when the inital uninstall file failed.

Sorry for the dropbox links, can't post imgs until I have a better rep.

2
Hmm, I never use [UninstallDelete] section in my InnoSetup script and still the InnoSetup uninstaller works correctly. I wonder what is wrong in your InnoSetup script... - ee.
Maybe, you should put double-quotes in between those strings with spaces under [Setup] section...just my guess for a solution... - ee.
Or, you can define a variable to represent a repetitive string: for example #define MyTitleName "Life Goes On Demo" and use the {#MyTitleName} identifier like this: DefaultDirName={pf}\{#MyTitleName}. By doing this, you can avoid the mistake due to unseen whitespaces in those repetitive strings. - ee.
Thanks for you responses, I tried both of them, with no luck. The uninstaller doesn't seem to have any difficulty locating the path/files to delete, it just fails to actually delete them. Almost makes me think it's a permissions issue, but wouldn't it throw an error if that was the case? - Susan Wright
Which files/directories that aren't deleted? Can you snapshot a few images before and after un-installation and attach them in your post? - ee.

2 Answers

1
votes

Unless you've told it otherwise, Inno will remove everything that it installed.

Also, doing an explicit [UninstallDelete] on a folder can have adverse side effects, especially if you have the wrong path ({app} vs {pf}\blah). Imagine if someone installed your app into C:\Windows\? You've just wiped out their Windows installation!

-2
votes

I got what you are doing wrong, you should remove the

UninstallFilesDir={app}\uninst part Default is {app}

And dont use [UninstallDelete].with the above method it should remove all the files. If you want to use [UninstallDelete] then use

[UninstallDelete]
Name: {app}\; Type: filesandordirs

Instead of

[UninstallDelete] Type: filesandordirs; Name: "{pf}\Files"

TRY IT