[英]How to apply a skin to Inno Setup uninstaller with the ISSkin library?
除非用戶運行卸載程序,否則您必須將ISSkin.dll
庫以及外觀文件解壓縮到某個目錄中並保存。 這是因為卸載程序是由安裝程序生成的應用程序,因此它們只是不同(卸載程序,例如不包含可以提取的文件)。
您還需要考慮,如果您希望將整個卸載過程設置為皮膚,則需要在卸載過程的最后卸載ISSkin.dll
庫,這將需要您刪除手動使用皮膚文件的庫。 為此,我強烈建議您使用與應用程序不同的文件夾,以允許卸載程序正確刪除應用程序,其余部分由您自己執行。 這是一個腳本示例,用於此本地應用程序數據文件夾:
您也可以按照此代碼的注釋版本進行操作 。
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
OutputDir=userdocs:Inno Setup Examples Output
#define SetupSkinPath "{localappdata}\SetupSkin"
[Files]
Source: ISSkinU.dll; DestDir: {#SetupSkinPath}; Flags: uninsneveruninstall
Source: Styles\Office2007.cjstyles; DestDir: {#SetupSkinPath}; Flags: uninsneveruninstall
[Code]
procedure SetupLoadSkin(lpszPath: string; lpszIniFileName: string);
external 'LoadSkin@files:ISSkinU.dll stdcall setuponly';
procedure SetupUnloadSkin;
external 'UnloadSkin@files:ISSkinU.dll stdcall setuponly';
procedure UninstLoadSkin(lpszPath: string; lpszIniFileName: string);
external 'LoadSkin@{#SetupSkinPath}\ISSkinU.dll stdcall uninstallonly';
procedure UninstUnloadSkin;
external 'UnloadSkin@{#SetupSkinPath}\ISSkinU.dll stdcall uninstallonly';
function ShowWindow(hWnd: HWND; nCmdShow: Integer): BOOL;
external 'ShowWindow@user32.dll stdcall';
function InitializeSetup: Boolean;
begin
Result := True;
ExtractTemporaryFile('Office2007.cjstyles');
SetupLoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), 'NormalBlack.ini');
end;
procedure DeinitializeSetup;
begin
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), SW_HIDE);
SetupUnloadSkin;
end;
function InitializeUninstall: Boolean;
begin
Result := True;
UninstLoadSkin(ExpandConstant('{#SetupSkinPath}\Office2007.cjstyles'),
'NormalBlack.ini');
end;
procedure DeinitializeUninstall;
begin
UninstUnloadSkin;
UnloadDLL(ExpandConstant('{#SetupSkinPath}\ISSkinU.dll'));
DeleteFile(ExpandConstant('{#SetupSkinPath}\ISSkinU.dll'));
DeleteFile(ExpandConstant('{#SetupSkinPath}\Office2007.cjstyles'));
RemoveDir(ExpandConstant('{#SetupSkinPath}'));
end;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.