Muddyblack k
Muddyblack k

Reputation: 252

Inno Setup UninstallIcon Disappears

I am doing something wrong with the UninstallerIcon I use this piece of Code:

UninstallDisplayIcon=....(Iconlocation)

and then when I unplug the Disk with the Icon the icon disappears:

enter image description here

enter image description here

I hope you can help me out :)

Best Regards,

Christian

Upvotes: 2

Views: 207

Answers (2)

gully
gully

Reputation: 11

I was struggling with the same problem. The thing is that if you use the standard help solution using the UninstallDisplayIcon directive, for some reason the uninstall icon does not appear. Try adding the following code to the script:

procedure CurStepChanged(CurStep: TSetupStep);
        begin
            case CurStep of
//          ssInstall:
//            Do_Pre_Install();
//          ssPostInstall:
//            Do_Post_Install();
            ssDone:
                // Update the Registry with the Uninstall icon from the unistaller.
                //
                RegWriteStringValue(HKEY_LOCAL_MACHINE,
                'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#TheAppId}_is1',
                'DisplayIcon',
                ExpandConstant('{uninstallexe}')); // specify this parameter as needed
            end;
        end;

Upvotes: 0

Martin Prikryl
Martin Prikryl

Reputation: 202118

The UninstallDisplayIcon must point to a permanent file on the destination machine. Not to the source drive of the installer. That typically means that you have to install the icon and point the UninstallDisplayIcon to the installed copy:

[Setup]
UninstallDisplayIcon={app}\uninstall.ico

[Files]
Source: uninstall.ico; DestDir: {app}

Note that the UninstallDisplayIcon is loaded by Windows on the destination machine, not Inno Setup itself. Windows supports other formats, like .exe and .dll, in addition to .ico.

Upvotes: 3

Related Questions