The previously compiled Inno Setup script covers the custom installation interface, calling DLL, and other applications.

Source: Internet
Author: User
Tags configuration settings
; Script generated by the Inno Setup script wizard.; see the documentation for details on creating Inno Setup script files !; 1 indicates the trial version # define version_type readini ('setup. INI ', 'setuptype', 'type', '0') # If version_type = "2" # define live_version # define myappname "streaming media system (PMS) "# define myappid" plugin "# define myoutputbasefilename" live_server_setup "# Elif version_type =" 1 "# define vod_version # define myappname" streaming media system (PMS) "# define myappid" DA255679-F103-4170-8B75-B9A7EF4CBC1B "# define myoutput Basefilename "vod_server_setup" # else # define full_version # define myappname "streaming media system (PMS) "# define myappid" plugin "# define myoutputbasefilename" full_server_setup "# endif # define regurl" http://www.xxx.net "# define myappversion" 1.0 "# define myapppublisher" XXX Technology Co., Ltd. "# define myappurl" http://www.xxx.net "# define myappexename" instanceconfig.exe "[setup]; note: The value of appid Uniquely identifies this application .; do not use the same appid value in installers for other applications .; (to generate a new guid, Click Tools | generate guid inside the IDE .) appid ={{# myappid }}appmutex ={{{# myappid }}appname ={# myappname} appversion ={# myappversion} apppublisher ={# myapppublisher} apppublisherurl = {# myappurl} appsupporturl ={# myappurl} appupdatesurl ={# myappurl} defaultdirname = {pf} \ XXX \ me Dia serverdefagroupgroupname={myappname=allownoicons=yeslicensefile=license.txt outputdir = outputoutputbasefilename ={# myoutputbasefilename} setupiconfile = setup. icocompression = versions = yesversioninfoversion ={# myappversion} versioninfocompany ={# myapppublisher} versioninfocopyright = copyright (c) versions ={# myappname} versioninfoproductversion ={# myappversion} [ages] Name: CN; messagesfile: Compiler: Ages \ Chinese. isl [files]; Note: Don't use "Flags: ignoreversion" on any shared system files; used to check whether the registration code entered in the installation program is valid source :.. \ build \ register_help.dll; flags: dontcopysource :.. \ build \ libeay32.dll; flags: dontcopysource :.. \ build \ vcredist2008_x86.exe; flags: dontcopy # ifdef full_versionsource :.. \ build \ Server. conf; destdir: {app} Source :.. \ build \ media_service.exe; destd IR: {app} Source :.. \ build \ libmysql. DLL; destdir: {app} Source :.. \ build \ libeay32.dll; destdir: {app} Source :.. \ build \ zlib1.dll; destdir: {app} Source :.. \ build \ register_check.exe; destdir: {app} Source :.. \ build \ qtcore4.dll; destdir: {app} Source :.. \ build \ qtgui4.dll; destdir: {app} Source :.. \ build \ mglobal. DLL; destdir: {app} Source :.. \ build \ msvcp100.dll; destdir: {app} Source :.. \ build \ msvcr100.dll; d Estdir: {app} Source :.. \ build \ initconfig.exe; destdir: {app} Source :.. \ build \ instanceconfig.exe; destdir: {app}; Source :.. \ build \ php-fpm.exe; destdir: {app} Source :.. \ build \ manage statistics page. URL; destdir: {app} Source :.. \ build \ Sample Page. URL; destdir: {app} Source :.. \ build \ launchlist; destdir: {app}; Source :.. \ build \ phpcgi; destdir: {app} Source :.. \ build \ Lighttpd. conf; destdir: {app} \ LMP \ Lighttpd \ conf; flags: igno Reversionsource :.. \ build \ My. INI; destdir: {app} \ LMP \ mysql; flags: ignoreversion; full Web Server Directory Source :.. \ build \ LMP \ *; destdir: {app} \ LMP; flags: recursesubdirs createallsubdirs; DOC file directory Source :.. \ doc \ *; destdir: {app} \ help; flags: recursesubdirs createallsubdirs; Source :.. \ build \ SWFs \ *; destdir: {app} \ SWFs; flags: recursesubdirs createallsubdirs; Source :.. \ build \ scriptlib \ *; destd IR: {app} \ scriptlib; flags: recursesubdirs createallsubdirs # endif [dirs] Name: {app} \ videos [Tasks] Name: desktopicon; Description: {CM: create‑topicon }; groupdescription: {CM: additionalicons} [icons] Name: {group} \ sample \ Sample Page; filename: {app} \ Sample Page. urlname: {group} \ HELP \ installation instructions; filename: {app} \ HELP \ installation instructions: {group} \ HELP \ function instructions; filename: {app} \ HELP \ Function Description Example name: {group} \ HELP \ development description; filename: {app} \ el P \ development instructions consumer name: {group} \ HELP \ configuration instructions; filename: {app} \ HELP \ configuration description consumer name: {group} \ HELP \ statistics module; filename: {app} \ HELP \ Statistics consumer name: {group} \ streaming media system (PMS) system configuration; filename: {app }\{# myappexename} Name: {group }\{ CM: uninstallprogram, PMS System Configuration}; filename: {uninstallexe} Name: {group} \ statistics management of streaming media system (PMS); filename: {app} \ management statistics page. URL; iconfilename: {app }\{# myappexename}; Name: {commondesktop} \ statistics management of streaming media system (PMS); filename: {app} \ Management System Page. URL; tasks: Required topicon; iconfilename: {app }\{# myappexename}; Name: {commondesktop} \ streaming media system (PMS) system configuration; filename: {app }\{# myappexename}; tasks: desktopiconname: {commondesktop} \ Enable PMS service; filename: {app} \ media_service.exe; parameters:-R; iconfilename: {app }\{# myappexename}; tasks: Stopping topiconname: {commondesktop} \ stop PMS service; filename: {app} \ media_service.exe; parameters:-S; iconfilename: {app }\{# MyApp Exename}; tasks: Export topicon [run]; Delete service filename: {app} \ media_service.exe; parameters:-U; flags: runhidden; install service filename: {app} \ media_service.exe; parameters:-I; flags: runhidden [uninstallrun]; stop service filename: {app} \ media_service.exe; parameters:-S; flags: runhidden; Delete service filename: {app} \ media_service.exe; parameters:-U; flags: runhidden [custommessages] key_form_caption = Registration Wizard key_form_description = Sequence Id submitted to XXX to obtain the registration code token = serial number: token = registration code: domain_form_caption = domain name setting domain_form_description = configure the current server domain name [messages] beveledlabel = xxx Network Technology [Code] varcodelabel: tlabel; keylabel: tlabel; key: tmemo; Code: tmemo; keypage: twizardpage; domainedit: tnewedit; domainpage: twizardpage; // obtain the serial number function getcode (szcode: pchar; inlen: integer ): integer; External 'getcode @ files: register_el P. DLL, libeay32.dll, msvcr100.dll stdcall setuponly delayload loadwithalteredsearchpath '; // check function regcheck (const regkey: pchar): Boolean; External 'regcheck @ files: limit, libeay32.dll, msvcr100.dll stdcall setuponly delayload loadwithalteredsearchpath '; // register function regsave (const regkey, regpath: pchar): Boolean; External 'regsave @ files: files, libeay32.dll, msvcr100.dll Call setuponly delayload upload'; // clear and Register Procedure regclear (const regpath: pchar); External 'regclear @ files: Large, libeay32.dll, msvcr100.dll stdcall setuponly delayload loadwithalteredsearchpath '; function openscmanager (const machine: longint; const dbname: longint; Access: DWORD): longint; External 'openscmanagera @ advapi32.dll stdcall'; function openservice (svcmgr: longint; Const svcname: pchar; Access: DWORD): longint; External 'openservicea @ javasstdcall'; function closeservicehandle (svc: longint): Boolean; External 'closeservicehandle @ advapi32.dll stdcall '; /// determine whether the service has function serviceexists (Name: string): Boolean; var svcmgr, svc: longint; begin result: = false; svcmgr: = openscmanager (0, 0, 1 ); if svcmgr = 0 Then exit; SVC: = openservice (svcmgr, pchar (name), 4); I F SVC = 0 then begin closeservicehandle (svcmgr); exit; end; closeservicehandle (SVC); closeservicehandle (svcmgr); Result: = true; end; // stop procedure stopservice; vaR resultcode: integer; begin exec (expandconstant ('{TMP} \ media_service.exe'), '-S', '', sw_hide, ewwaituntilterminated, resultcode); end; {key_form_shouldskippage} function key_form_shouldskippage (page: twizardpage): Boolean; varcodestr: Str Ing; beginsetlength (codestr, 1024); getcode (pchar (codestr), 1024); Code. text: = codestr; Result: = false; end; // The registration code edit box changes the event procedure key_form_keychange (Sender: tobject); begin // checks the registration code if regcheck (pchar (key. text) thenwizardform. nextbutton. enabled: = trueelsewizardform. nextbutton. enabled: = false; end; Procedure regurllabelonclick (Sender: tobject); var errorcode: integer; begin shellexec ('open', expandconstan T ('{# regurl}'), '','', sw_shownormal, ewnowait, errorcode); end; {key_form_createpage} function key_form_createpage (previouspageid: integer): integer; vaR urllabel: tnewstatictext; beginkeypage: = createcustompage (response, expandconstant ('{CM: Container}'), expandconstant ('{CM: key_form_description}'); {codelabel} codelabel: = tlabel. create (keypage); with codelabel dobeginparent: = Ke Ypage. surface; caption: = expandconstant ('{CM: key_form_codelabel_caption0}'); left: = scalex (0); top: = scaley (0); width: = scalex (40 ); height: = scaley (13); end; {keylabel} keylabel: = tlabel. create (keypage); with keylabel dobeginparent: = keypage. surface; caption: = expandconstant ('{CM: key_form_keylabel_caption0}'); left: = scalex (0); top: = scaley (82); width: = scalex (40 ); height: = scaley (13); end; {key} Key: = tmemo. create (keypage); with key dobeginparent: = keypage. surface; left: = scalex (0); top: = scaley (98); width: = scalex (410); Height: = scaley (106); scrollbars: = ssvertical; taborder: = 0; onchange: = @ key_form_keychange; end; {code} code: = tmemo. create (keypage); with code dobeginparent: = keypage. surface; left: = scalex (0); top: = scaley (16); width: = scalex (410); Height: = scaley (60); readonly: = T Rue; scrollbars: = ssvertical; taborder: = 1; end; with keypage dobeginonshouldskippage: = @ key_form_shouldskippage; end; Result: = keypage. ID; urllabel: = tnewstatictext. create (keypage); with urllabel do begin caption: = 'get registration Code'; cursor: = crhand; onclick: = @ regurllabelonclick; parent: = keypage. surface; font. style: = urllabel. font. style + [fsunderline]; font. color: = clblue; left: = scalex (350); top: = Scaley (210); end; {code for setting the domain name page} procedure domain_form_editchange (Sender: tobject); begin if domainedit. TEXT = ''then wizardform. nextbutton. enabled: = false else wizardform. nextbutton. enabled: = true; end; function compute (previouspageid: integer): integer; var domainlabel: tnewstatictext; begindomainpage: = createcustompage (previouspageid, expandconstant ('{CM: Example} '), Expandconstant (' {CM: domain_form_description} '); domainlabel: = tnewstatictext. create (domainpage); with domainlabel do begin parent: = domainpage. surface; caption: = 'ensure that the entered domain name is valid and point to the current server IP address. Otherwise, you can directly enter the IP address of the Local Machine' + #13 #10 +, or keep the default value unchanged. '; left: = scalex (0); top: = scaley (60); width: = scalex (400); Height: = scaley (28); end; domainedit: = tnewedit. create (domainpage); with domainedit do begin parent: = do Mainpage. surface; text: = getcomputernamestring; left: = scalex (0); top: = scaley (90); width: = scalex (400); Height: = scaley (13 ); onchange: = @ domain_form_editchange; end; Procedure urllabelonclick (Sender: tobject); var errorcode: integer; begin shellexec ('open', expandconstant ('{# myappurl }'), '','', sw_shownormal, ewnowait, errorcode); end; // install the initialization function initializesetup (): Boolean; begin if servi Ceexists ('mediasrv ') then begin // The service exists. Stop it first if msgbox (' the service already exists. Do you want to continue? ', Mbconfirmation, mb_yesno) = IDNO then begin result: = false; exit; end; extracttemporaryfile('media_service.exe'); extracttemporaryfile ('msvcr100. dll '); extracttemporaryfile ('msvcp100. dll '); stopservice; end; Result: = true; end; Procedure initializewizard (); var urllabel: tnewstatictext; beginkey_form_createpage (wpselectdir); domain_form_createpage (keypage. ID); urllabel: = tnewstatictext. create (wizardform); with urllabel do begin caption: = expandconstant ('{# myappurl}'); cursor: = crhand; onclick: = @ urllabelonclick; parent: = wizardform; font. style: = urllabel. font. style + [fsunderline]; font. color: = clblue; left: = scalex (20); top: = wizardform. clientheight-scaley (30); end; // page switching event procedure curpagechanged (curpageid: integer); var resultcode: integer; file: string; Buf: string; begin wizardform. backbutton. enabled: = true; If curpageid = keypage. ID then wizardform. nextbutton. enabled: = false else if curpageid = wpfinished then begin /////////////////////////////// //// // The help code is used to set host_name as the domain name file set by the user: = expandconstant ('{app} \ LMP \ htdocs \ sample \ config. PHP '); If loadstringfromfile (file, Buf) then begin stringchangeex (BUF,' % host_name % ', domainedit. text, false); savestringtofile (file, Buf, false); end; file: = expandconstant ('{app} \ management statistics page. URL '); If loadstringfromfile (file, Buf) then begin stringchangeex (BUF,' % host_name % ', domainedit. text, false); savestringtofile (file, Buf, false); end; file: = expandconstant ('{app} \ Example page. URL '); If loadstringfromfile (file, Buf) then begin stringchangeex (BUF,' % host_name % ', domainedit. text, false); savestringtofile (file, Buf, false); end; //////////////////////////////////////// ///////////////////// click the wizardform button to disable the function. nextbutton. enabled: = false; // formally write the registration file regsave (pchar (key. text), wizarddirvalue); // execute automatic initialization exec (expandconstant ('{app} \ initconfig.exe'), '','', sw_hide, ewwaituntilterminated, resultcode ); // execute the configuration settings exec (expandconstant ('{app} \ instanceconfig.exe'), '-R', '', sw_show, ewwaituntilterminated, resultcode ); // start the service EXEC (expandconstant ('{app} \ media_service.exe'), '-R',', sw_hide, ewwaituntilterminated, resultcode); // enable the finish button wizardform. nextbutton. enabled: = true; end else if curpageid = wpinstalling then begin // install the Runtime Library extracttemporaryfile('vcredist2008_x86.exe '); // run exec (expandconstant ('{TMP} \ vcredist2008_x86.exe'), '/Q', '', sw_hide, ewwaituntilterminated, resultcode) in the 2008 library ); end else if curpageid = domainpage. ID then begin wizardform. backbutton. enabled: = false; end; // uninstall procedure curuninstallstepchanged (curuninstallstep: tuninstallstep ); begin if curuninstallstep = usuninstall then begin deletefile (expandconstant ('{app} \ LSC'); end; // check the restart logic function uninstallneedrestart (): Boolean; begin if serviceexists ('mediasrv ') then result: = true else result: = false; end;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.