unisntallerの最初と最後のメッセージを非表示にしたい。このコードは(簡単に表示され、消えます)Inno Setupの(Inno Setupのウルトラ5.5.1.ee2)の修正版で動作しますが、最初のメッセージを非表示にするうまく動作しません: Inno Setup - アンインストールのプロンプトを自動的に送信する
function FindWindowEx(Parent, Child: HWND; ClassName, WindowName: PansiChar): HWND;
external '[email protected] stdcall';
const
BM_CLICK = $00F5;
var
Timer: TTimer;
msg: string;
Wnd, WndEx: HWND;
procedure OnTimer(Sender: TObject);
begin
Wnd:= FindWindowByWindowName(msg);
if Wnd > 0 then
begin
WndEx:= FindWindowEx(Wnd, 0,'Button', '');
if WndEx > 0 then
begin
PostMessage(WndEx, BM_CLICK, 0, 0);
Timer.Enabled:= False;
end;
end;
end;
function InitializeUninstall:boolean;
begin
Result := True;
msg:= SetupMessage(msgUninstallAppFullTitle);
StringChange(msg, '%1', '{#SetupSetting('AppName')}');
OnTimer(nil);
Timer:= TTimer.Create(nil);
with Timer do
begin
OnTimer:= @OnTimer;
Interval:= 1;
Enabled:= True;
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep=usPostUninstall then
begin
OnTimer(nil);
Timer:= TTimer.Create(nil);
with Timer do
begin
OnTimer:= @OnTimer;
Interval:= 1;
Enabled:= True;
end;
end;
end;
がどのようにこのコードを変更します現在の公式バージョンのInno Setupで正しく動作し、両方のメッセージを正しく隠すことができますか?
Inno Setupには 'TTimer'クラスはありません。 Inno Setupのサードパーティビルドを使用していますか? –
@MartinPrikrylこのコードは、Inno Setup(Inno Setup Ultra 5.5.1.ee2)の修正版で動作します。私はInno Setupの最後のバージョンを使用しています。 –
@MartinPrikryl私はこの情報で自分の投稿を編集しました。 –