Inno Setup not showing correct icon in desktop, because of iconcache in windows (Tablet)

26 Views Asked by At

Innosetup is what we're utilizing to generate the application. We occasionally receive icon updates as mandatory, however the issue Owing to Windows' iconcache, after we developed the application with the modified icon, the built icon did not appear on the desktop.

Is there a way to fix it or delete the innosetup cache connected to the icon?

We have attempted the following strategies, but to no avail.

  1. In version 2, we maintained the icons in a new position. but no luck
  2. We tried to trigger that batch file in innosetup, but we were unable to trigger "explorer.exe" via innosetup. We have a batch file that kills the explorer and restarts it manually; we cannot ask the customer to execute the batch file.
  3. Below code is working for me after long search
    [Code]
const
  SHCNE_ASSOCCHANGED = $08000000;
  SHCNF_IDLIST = $00000000;
  installation = true;

procedure SHChangeNotify(wEventID: Integer; uFlags: Cardinal; dwItem1, dwItem2: Cardinal);
  external '[email protected] stdcall';

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then
  begin
    if installation then
    begin
      SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
    end;
  end;
  if CurStep = ssPostInstall then
  begin
    if installation then
    begin
      SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
    end;
  end;
  if CurStep = ssDone then
  begin
    if installation then
    begin
      SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
    end;
  end;
end;


   [setup]
   ChangesAssociations=yes
0

There are 0 best solutions below