[Code] // Plug-in function usage // Parameter: handle (parent handle of the plug-in error dialog box), full path name of the EXE file, icon Resource Name (to be replaced in the EXE file), full path name of the icon file, (the resource of the icon to be replaced in exe) language family // Return value: Success = TR, failure = false Function updateicon (const hwnd: integer; const exefilename, exeicon, icofilename: string; wlangid: DWORD): Boolean; External '[email protected]: updateicon. dll stdcall '; // Replace the uninstall program icon Function updateuninsticon (const icofilename: string): Boolean; Begin // If the path name of the EXE file to be replaced is left blank, the plug-in will automatically replace the Inno uninstall program icon. Other parameters are similar! Result: = updateicon (mainform. Handle, '','', icofilename, 0 ); // Replace the uninstall icon End; Procedure curstepchanged (curstep: tsetupstep ); VaR Sicon: string; Begin // Note: the icon for replacing the uninstall program must be before the uninstall program is generated! // The format and size of the installation icon and uninstallation icon are the same. Otherwise, the uninstallation program may fail! If curstep = ssinstall then Begin Sicon: = expandconstant ('{TMP} \ Uninstall. ICO'); // defines the uninstall icon Extracttemporaryfile (extractfilename (Sicon); // release the unload icon // If the path name of the EXE file to be replaced is left blank, the plug-in will automatically replace the Inno uninstall program icon! Updateuninsticon (Sicon); // Replace the unload icon End; End; |