I am slightly confused with this VCL Styles plugin. I am specifically interested in the Uninstaller side of things.
The sample they provide goes like this:
#define VCLStylesSkinPath "{localappdata}\VCLStylesSkin"
[Files]
Source: ..\VclStylesinno.dll; DestDir: {#VCLStylesSkinPath}; Flags: uninsneveruninstall
Source: ..\Styles\Amakrits.vsf; DestDir: {#VCLStylesSkinPath}; Flags: uninsneveruninstall
[Code]
{ Import the LoadVCLStyle function from VclStylesInno.DLL }
procedure LoadVCLStyle(VClStyleFile: String);
external 'LoadVCLStyleW@files:VclStylesInno.dll stdcall setuponly';
procedure LoadVCLStyle_UnInstall(VClStyleFile: String);
external 'LoadVCLStyleW@{#VCLStylesSkinPath}\VclStylesInno.dll stdcall uninstallonly';
{ Import the UnLoadVCLStyles function from VclStylesInno.DLL }
procedure UnLoadVCLStyles;
external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall setuponly';
procedure UnLoadVCLStyles_UnInstall;
external 'UnLoadVCLStyles@{#VCLStylesSkinPath}\VclStylesInno.dll stdcall uninstallonly';
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('Amakrits.vsf');
LoadVCLStyle(ExpandConstant('{tmp}\Amakrits.vsf'));
Result := True;
end;
procedure DeinitializeSetup();
begin
UnLoadVCLStyles;
end;
function InitializeUninstall: Boolean;
begin
Result := True;
LoadVCLStyle_UnInstall(ExpandConstant('{#VCLStylesSkinPath}\Amakrits.vsf'));
end;
procedure DeinitializeUninstall();
begin
UnLoadVCLStyles_UnInstall;
end;
I am interested in this bit:
Source: ..\VclStylesinno.dll; DestDir: {#VCLStylesSkinPath}; Flags: uninsneveruninstall
Source: ..\Styles\Amakrits.vsf; DestDir: {#VCLStylesSkinPath}; Flags: uninsneveruninstall
I understand that the files need to be installed because they are required by the uninstaller. But why would you use the uninsneveruninstall
flag? Is that acceptable behaviour?
It's a DLL. It's loaded into the uninstaller. So the uninstaller cannot delete it. So the flag is there, to avoid the uninstaller from failing when pointlessly trying to delete the file.
For a better solution, see the second part of my answer to:
Load external DLL for uninstall process in Inno Setup