看了网上大家关于更改卸载图标的帖子,未能理想的解决这个问题,于是想了个土办法解决掉了它。
1. 在Startup Menu菜单中的图标
[ICON]
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}";IconFilename: "{app}\unins000.exe"
安装程序安装时会将安装程序的图标更新到时unins000.exe中,菜单中的卸载图标将源自于unins000.exe文件。与其安装程序要修改unins000.exe中的图标,索性自己用ResourceHacker程序把Inno Setup安装程序的unins000.exe图标改掉(网上搜,然后自己改成自己的图标,此处略过),并另存为unins111.exe,然后就是找个时机删掉安装完的unins000.exe,再将unins111.exe考贝到原文件unins000.exe,至此,菜单的卸载图标与修改考贝过的unins000.exe对应上了。接下来,删掉unins111.exe,如下:
procedure DeinitializeSetup ();
var
ra: boolean;
Begin
ra := DeleteFile(ExpandConstant('{app}\unins000.exe'));
FileCopy(ExpandConstant('{app}\unins111.exe'), ExpandConstant('{app}\unins000.exe'),ra);
ra := DeleteFile(ExpandConstant('{app}\unins111.exe'));
end;
当然,如果有个UpdateIcon函数可用当然好了,无奈没有呢。Inno setup对大家是小菜儿,就我接触时间不长,无奈留好unins111.exe,以后就用它吧。