0

This is related to this question.

My [Files] section is as the official example (although I have also tried with removal of the Flags for each line):

[Files]
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: {#InnoPath}\VclStylesinno.dll; DestDir: "{app}"; Flags: uninsneveruninstall

; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: {#InnoPath}\Styles\{#Skin}; DestDir: "{app}"; Flags: uninsneveruninstall

This is how my uninstaller works in the [Code] section:

function InitializeUninstall: Boolean;
begin
  Result := True;

  if FileCopy(ExpandConstant('{app}\VclStylesinno.dll'),
              ExpandConstant('{%TEMP}\VclStylesinno.dll'), False) and
     FileCopy(ExpandConstant('{app}\{#Skin}'),
              ExpandConstant('{%TEMP}\{#Skin}'), False)then
  begin
    LoadVCLStyle_UnInstall(ExpandConstant('{app}\{#Skin}'));
  end;  
end;

procedure DeinitializeUninstall();
begin
  UnLoadVCLStyles_UnInstall;
end;

I find that after the uninstall finishes the VclStylesinno.dll file remains in the application data folder.

I load the actual procedures using the official example:

{ Import the UnLoadVCLStyles function from VclStylesInno.DLL }
procedure UnLoadVCLStyles; external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall setuponly';
procedure UnLoadVCLStyles_UnInstall; external 'UnLoadVCLStyles@{app}\VclStylesInno.dll stdcall uninstallonly';

Update

Here is the uninstall log:

https://www.dropbox.com/s/mzjebitwvkirhto/msa-log.txt?dl=0

  • I changed the [File] entries:
    [Files]
    ; Add the ISSkin DLL used for skinning Inno Setup installations.
    Source: {#InnoPath}\VclStylesinno.dll; DestDir: "{app}"

    ; Add the Visual Style resource contains resources used for skinning,
    ; you can also use Microsoft Visual Styles (*.msstyles) resources.
    Source: {#InnoPath}\Styles\{#Skin}; DestDir: "{app}"
  • I changed this to use the {%TEMP} folder:
    function InitializeUninstall: Boolean;
    begin
      Result := True;

      if FileCopy(ExpandConstant('{app}\VclStylesinno.dll'),
                  ExpandConstant('{%TEMP}\VclStylesinno.dll'), False) and
         FileCopy(ExpandConstant('{app}\{#Skin}'),
                  ExpandConstant('{%TEMP}\{#Skin}'), False)then
      begin
        LoadVCLStyle_UnInstall(ExpandConstant('{%TEMP}\{#Skin}'));
      end;  
    end;
  • And I changed:
    { Import the UnLoadVCLStyles function from VclStylesInno.DLL }
    procedure UnLoadVCLStyles; external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall setuponly';
    procedure UnLoadVCLStyles_UnInstall; external 'UnLoadVCLStyles@{%TEMP}\VclStylesInno.dll stdcall uninstallonly delayload';

The DLL still remains in the app folder.

Update 2

Did uninstall as requested, manually deleted the DLL file, and performed fresh install / uninstall. The app folder is now empty!

Is there any reason that the main app folder does not get deleted now since it is empty?

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • What's nothing in your example that would make the .dll be deleted. + Log file would be useful as well. – Martin Prikryl Jun 03 '20 at 19:24
  • @MartinPrikryl In the other question you stated that we should follow the official documentation. I am stating that the official documentation leaves the DLL in the installed folder. So by design they leave it behind and do not offer us an example for removing it to perform a clean uninstall. I can provide a log file tomorrow. – Andrew Truckle Jun 03 '20 at 21:02
  • I do not think you understood the point of my comment. The `{app}\VclStylesinno.dll` file does not get deleted on its own. It gets deleted only as a consequence of some script entry (like the [`[Files]` section here](https://stackoverflow.com/q/36940506/850848#36941766)). Your question does not include any such entry. Also your question does not show how you load the DLL in the uninstaller. Basically, we need [mcve]. – Martin Prikryl Jun 04 '20 at 05:10
  • @MartinPrikryl I am confused here. I tried `unins000 /log =d:\msa-uninstall.txt` from my installed folder and no log was created. – Andrew Truckle Jun 04 '20 at 07:45
  • 1
    No space after `/log`. – Martin Prikryl Jun 04 '20 at 07:50
  • 1
    Anyway, you are not loading your temporary copy of the DLLs. You are loading the DLL from `{app}`, so it cannot be deleted. Again, see https://stackoverflow.com/q/36940506/850848#36941766 – Martin Prikryl Jun 04 '20 at 07:54
  • @MartinPrikryl Still no joy, see updated question. – Andrew Truckle Jun 04 '20 at 08:30
  • 1
    Uninstall your app, manually delete the rest. Run the installation and uninstallation and post logs for both. – Martin Prikryl Jun 04 '20 at 08:32
  • @MartinPrikryl Please see my results. – Andrew Truckle Jun 04 '20 at 08:43
  • 1
    So you do not have the problem with the DLL anymore? – Regarding the folder: The installer did not create it (it did exist already) - So the uninstaller did not delete it. – Martin Prikryl Jun 04 '20 at 09:53
  • @MartinPrikryl Gotcha. I think it is all OK now. – Andrew Truckle Jun 04 '20 at 09:55

0 Answers0