1、win10自己注冊表關聯的卸載圖標 會隱藏 卸載圖標。現在的項目法是 不寫注冊表 直接 在目標文件里面創建快捷方式 移動到菜單里面
; 腳本由 Inno Setup 腳本向導 生成!
; 有關創建 Inno Setup 腳本文件的詳細資料請查閱幫助文檔!
#define MyAppName ""
#define Close "卸載"
#define MyAppVersion "1.0"
#define MyAppPublisher ""
#define MyAppExeName ".exe"
#define MyUnins "卸載.exe"
[Setup]
; 注: AppId的值為單獨標識該應用程序。
; 不要為其他安裝程序使用相同的AppId值。
; (若要生成新的 GUID,可在菜單中點擊 "工具|生成 GUID"。)
AppId=
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName=采集工具2.0
DisableProgramGroupPage=yes
; 以下行取消注釋,以在非管理安裝模式下運行(僅為當前用戶安裝)。
;PrivilegesRequired=lowest
OutputBaseFilename=采集工具2.0
Compression=lzma
SolidCompression=yes
WizardStyle=modern
PrivilegesRequired=admin
[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
[code]
procedure CurStepChanged(CurStep: TSetupStep);
var
uninspath, uninsname, NewUninsName, MyAppName: string;
begin
if CurStep=ssDone then
begin
// 指定新的卸載文件名(不包含擴展名),請相應修改!
NewUninsName := '卸載';
// 應用程序名稱,與 [Setup] 段的 AppName 必須一致,請相應修改!
MyAppName := '采集工具';
// 以下重命名卸載文件
uninspath:= ExtractFilePath(ExpandConstant('{uninstallexe}'));
uninsname:= Copy(ExtractFileName(ExpandConstant('{uninstallexe}')),1,8);
RenameFile(uninspath + uninsname + '.exe', uninspath + NewUninsName + '.exe');
RenameFile(uninspath + uninsname + '.dat', uninspath + NewUninsName + '.dat');
// 以下修改相應的注冊表內容
if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + MyAppName + '_is1') then
begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + MyAppName + '_is1', 'UninstallString', '"' + uninspath + NewUninsName + '.exe"');
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + MyAppName + '_is1', 'QuietUninstallString', '"' + uninspath + NewUninsName + '.exe" /silent');
end;
end;
end;
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone
;Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "E:\client\新建文件夾 (2)\people\people\bin\Release\采集工具.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\client\新建文件夾 (2)\people\people\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; 注意: 不要在任何共享系統文件上使用“Flags: ignoreversion”
[Icons]
;Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";
;Name: "{commonprograms}\卸載 {#MyAppName}"; Filename:{uninstallexe}; WorkingDir: {app};
;Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon ;
//開始菜單快捷方式
Name: "{commonprograms}\{#MyAppName}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: {app};
//桌面快捷方式
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
//開始菜單卸載程序
;Name: {commonprograms}\{#MyAppName}\卸載 {#MyAppName}; Filename:{uninstallexe}; WorkingDir: {app};
Name: {commonprograms}\{#MyAppName}\卸載 {#MyAppName}; Filename:{app}\{#MyUnins}; WorkingDir: {app};
;Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";
;卸載程序圖標
;Name: "{group}\{#Close}"; Filename: "{uninstallexe}";
;主程序圖標
;Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
;Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
;桌面卸載程序圖標
;Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[Registry]
Root: HKCR; Subkey: ".zjx"; ValueType: string; ValueName: ""; ValueData: "采集工具"
Root: HKCR; Subkey: "息采集工具\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"; Flags: uninsdeletekey
Root: HKCR; Subkey: "采集工具\Shell\Open\Command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" %1"; Flags: uninsdeletekey
Root: HKCR; Subkey: "息采集工具\ShellNew"; ValueType: string; ValueName: "FileName"; ValueData: """{app}\{#MyAppExeName}"" %1"; Flags: uninsdeletekey
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent