Inno Setup launch executable (to install drivers) during installation -
i using inno setup create installer application. installer basic , copies files. works , happy it.
i implemented usb support , need install usb driver ivi foundation that. exe file has launched somewhere during setup process. until now, user has install drivers separately, not elegant. first approach this:
[run] filename: "{app}\driver\ivisharedcomponents_2.2.1.exe"; description: "install usb driver (ivi foundation)"; flags: postinstall skipifsilent filename: "{app}\driver\ivisharedcomponents64_2.2.1.exe"; description: "install 64bit usb driver (ivi foundation)"; flags: postinstall skipifsilent filename: "{app}\{#myappexename}"; description: "{cm:launchprogram,{#stringchange(myappname, "&", "&&")}}"; flags: postinstall skipifsilent
this works, user has select correct bitness. advantage here can choose not install (in case application ignores usb functionality fine). want detect bitness of system automatically , run setup process. not have in [run]
section, although not have against (because user can choose not install it).
i found code , tried run this:
[code] procedure curstepchanged (curstep: tsetupstep); var workingdir: string; returncode: integer; begin if (ssinstall = curstep) log('starting driver installation'); workingdir := expandconstant ('{app}\driver'); exec ('ivisharedcomponents_2.2.1.exe', '', workingdir, sw_show, ewwaituntilterminated, returncode); end;
but not start installation (although can see log entry 'starting driver installation'). there wrong path? doing wrong , how change script automatically select right executable depending on bitness?
edit: used proposed solution [tasks]
entry. implementation looks (just reference):
[tasks] name: "install_usb"; description: "install usb drivers (ivi foundation)"; groupdescription: "external drivers:"; [run] filename: "{app}\driver\ivisharedcomponents_2.2.1.exe"; statusmsg: "installing usb driver (ivi foundation)"; check: not iswin64(); tasks: install_usb; flags: skipifsilent filename: "{app}\driver\ivisharedcomponents64_2.2.1.exe"; statusmsg: "installing usb driver (ivi foundation)"; check: iswin64(); tasks: install_usb; flags: skipifsilent
this works well, lot help!
in case, it's best remove postinstall flag runs unconditionally @ end of setup process (but before says finished) , add check:
parameter limit correct bitness:
[run] filename: "{app}\driver\ivisharedcomponents_2.2.1.exe"; statusmsg: "installing usb driver (ivi foundation)"; check: not iswin64(); flags: skipifsilent filename: "{app}\driver\ivisharedcomponents64_2.2.1.exe"; statusmsg: "installing usb driver (ivi foundation)"; check: iswin64(); flags: skipifsilent
if want conditional, can use normal [tasks]
entry prompts before setup starts.
Comments
Post a Comment