Inno Setup - How to edit the "About Setup" dialog text box -
i need edit or replace text in about setup
dialog box text of inno setup.
here picture:
looking in net got code:
[setup] appname=my programme appvername=my programme v 1.5 defaultdirname={pf}\my programme outputdir=. [languages] name: "default"; messagesfile: "compiler:default.isl" [files] source: callbackctrl.dll; flags: dontcopy [code] type twfproc = function(h:hwnd;msg,wparam,lparam:longint):longint; function callwindowproc(lpprevwndfunc: longint; hwnd: hwnd; msg: uint; wparam: longint; lparam: longint): longint; external 'callwindowproca@user32.dll stdcall'; function setwindowlong(wnd: hwnd; index: integer; newlong: longint): longint; external 'setwindowlonga@user32.dll stdcall'; function wrapwfproc(callback: twfproc; paramcount: integer): longword; external 'wrapcallbackaddr@files:callbackctrl.dll stdcall'; var oldproc:longint; procedure aboutsetupclick; begin //edit text here msgbox('custom text here', mbinformation, mb_ok); end; function wfwndproc(h:hwnd;msg,wparam,lparam:longint):longint; begin if (msg=$112) , (wparam=9999) begin result:=0; aboutsetupclick; end else begin if msg=$2 setwindowlong(wizardform.handle,-4,oldproc); result:=callwindowproc(oldproc,h,msg,wparam,lparam); end; end; procedure initializewizard; begin oldproc:=setwindowlong(wizardform.handle,-4,wrapwfproc(@wfwndproc,4)); end;
seems work fine..
but if close installer, crash message.
please need help prepare code or give improve illustration alter text in setup dialog text box.
the dll used. here
you need give saved original windows procedure wizard form before exit setup application. so, utilize this:
const gwl_wndproc = -4; procedure deinitializesetup; begin setwindowlong(wizardform.handle, gwl_wndproc, oldproc); end;
anyway, can utilize more trustful library wrapping callbacks, innocallback
library. i've made review of code used , added back upwards unicode innosetup versions, expecting utilize of innocallback
library:
[setup] appname=my programme appversion=1.5 defaultdirname={pf}\my programme outputdir=userdocs:inno setup examples output [files] source: "innocallback.dll"; destdir: "{tmp}"; flags: dontcopy [code] #ifdef unicode #define aw "w" #else #define aw "a" #endif const gwl_wndproc = -4; sc_aboutbox = 9999; wm_syscommand = $0112; type wparam = uint_ptr; lparam = longint; lresult = longint; twindowproc = function(hwnd: hwnd; umsg: uint; wparam: wparam; lparam: lparam): lresult; function callwindowproc(lpprevwndfunc: longint; hwnd: hwnd; msg: uint; wparam: wparam; lparam: lparam): lresult; external 'callwindowproc{#aw}@user32.dll stdcall'; function setwindowlong(hwnd: hwnd; nindex: integer; dwnewlong: longint): longint; external 'setwindowlong{#aw}@user32.dll stdcall'; function wrapwindowproc(callback: twindowproc; paramcount: integer): longword; external 'wrapcallback@files:innocallback.dll stdcall'; var oldwndproc: longint; procedure showaboutbox; begin msgbox('hello, i''m box!', mbinformation, mb_ok); end; function wndproc(hwnd: hwnd; umsg: uint; wparam: wparam; lparam: lparam): lresult; begin if (umsg = wm_syscommand) , (wparam = sc_aboutbox) begin result := 0; showaboutbox; end else result := callwindowproc(oldwndproc, hwnd, umsg, wparam, lparam); end; procedure initializewizard; begin oldwndproc := setwindowlong(wizardform.handle, gwl_wndproc, wrapwindowproc(@wndproc, 4)); end; procedure deinitializesetup; begin setwindowlong(wizardform.handle, gwl_wndproc, oldwndproc); end;
inno-setup
No comments:
Post a Comment