Http://blog.sina.com.cn/s/blog_72c2eb350100y2sa.html
Someone mentioned that want to change the installation interface picture, in fact, the method is very simple, only need to modify the Inno Setup directory wizmodernimage.bmp and wizmodernsmallimage.bmp two pictures on it.
You can optimize your page by simply adding the following code to the code page.
#define MYAPPNAME "Service Side"
#define Myappversion "1.3.2"
#define Myapppublisher "ga526"
[Setup]
APPID={{59FB74DA-DBE1-41EF-B69A-31BE8324D98B}
appname={#MyAppName}
appversion={#MyAppVersion}
; appvername={#MyAppName} {#MyAppVersion}
apppublisher={#MyAppPublisher}
Defaultdirname=c:\ga526\ga526\ Service Side
Disabledirpage=yes
defaultgroupname=ga526 Service Side
Disableprogramgrouppage=yes
Outputdir=c:\documents and Settings\administrator\
Outputbasefilename=server
Setupiconfile=d:\ Desktop \ Icon \ga526.ico
Compression=lzma
Solidcompression=yes
[Files]
Flags cannot be less beforeinstall:changedisplay, this is called Changedisplay
Source: "C:\Documents and settings\administrator\desktop\ga5262011121\*"; DestDir: "{app}"; Flags:recursesubdirs Createallsubdirs; Beforeinstall:changedisplay
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\ server-side. exe"
Name: "{group}\{cm:uninstallprogram,{#MyAppName}}"; Filename: "{uninstallexe}" //In "Start"--"program", add a shortcut to uninstall Name: "C:\Documents and settings\administrator\" Start "menu \ program \ startup \ Program; Filename: "\ c \ my program. exe" //Here is a boot entry to add , of course, can also be modified by the registration to express this purpose
Name: "C:\Documents and settings\administrator\ desktop \ Service side"; Filename: "{app}\ server-side. exe"; //Here is Add Desktop shortcut
[Run]
Filename: "{app}\ server-side. exe"; Flags: "NoWait" //After installation is complete, run "server-side. exe" immediately
[Code]
Var
Detaillist:tnewlistbox;
Newfilenamelabel:tnewstatictext;
lastdir:string;
Procedure Initializewizard ();
Begin
Interface modification
wizardform.wizardsmallbitmapimage.left:=426;
Wizardform.taskslist.color:=clwindow;
Wizardform.innerpage.color:=clwindow;
Wizardform.readymemo.color:=clwindow;
Wizardform.pagenamelabel.font.color:= Clgreen;
Wizardform.pagedescriptionlabel.font.color:= Clgreen;
WizardForm.WelcomeLabel2.Caption: = ' Setup Wizard will install {#MyAppName} ' + #13 # # + on your PC
+ #13 # # +
' It is recommended that you close all other applications before proceeding. ' + #13 # # +
' + #13 # # +
' Click ' Next ' to continue, or click ' Cancel ' to return ';
Wizardform.welcomelabel1.font.color:= Clgreen;
Wizardform.welcomelabel1.top:= 31;
Wizardform.welcomelabel2.caption:= ' Please confirm that you are using for our products, otherwise, because of software and hardware '
+ #13 # # + + #13 # # + ' incompatible cause any problems, the company does not bear any legal liability. ‘
+ #13 # # + + #13 # # + ' suggest you turn off antivirus software before proceeding with the installation, and put the software on '
+ #13 # # + + #13 # # + ' installed in the C drive ' + ' click ' Next ' to continue installing the program, click ' Take '
+ #13 # # + + #13 # # + ' Cancel ' to exit the installation. ‘ ;
Wizardform.welcomelabel2.top:= 91;
Wizardform.color:= Clwindow;
wizardform.bevel1.left:=0;
wizardform.bevel1.top:=0;
wizardform.bevel1.width:=0;
wizardform.bevel.left:=0;
wizardform.bevel.top:=0;
Wizardform.selectdirbitmapimage.visible:=false;
Wizardform.selectgroupbitmapimage.visible:=false;
wizardform.selectdirlabel.left:=0;
wizardform.selectstartmenufolderlabel.left:=0;
wizardform.bevel.width:=0;
wizardform.pagedescriptionlabel.top:=40;
Page modification completed
//Show Details
detaillist:= tnewlistbox.create (wizardform);
detaillist.parent: = Wizardform.installingpage;
detaillist.left: = ScaleX (0);
detaillist.top: = ScaleY (70);
detaillist.width: = ScaleX (417);
detaillist.height: = ScaleY (153);
newfilenamelabel:= tnewstatictext.create (wizardform) //created Alternative to Filenamelabel
newfilenamelabel.parent: = wizardform.installingpage;
newfilenamelabel.top: = WizardForm.FileNameLabel.Top;
newfilenamelabel.left: = WizardForm.FileNameLabel.Left;
newfilenamelabel.width: = WizardForm.FileNameLabel.Width;
wizardform.filenamelabel.visible: = false; //hides the original Filenamelabel
lastdir:= ";
End;
Procedure Changedisplay;
var
dn, fn:string;
pct:Extended;
Begin
pct: = (wizardform.progressgauge.position-wizardform.progressgauge.min)/( Wizardform.progressgauge.max-wizardform.progressgauge.min) *100;
dn:= expandconstant (Extractfiledir (currentfilename));
fn:= Extractfilename (currentfilename);
wizardform.statuslabel.caption:= ' Output directory: ' + DN;
Newfilenamelabel.caption:= ' extract: ' + fn + ' (' + inttostr (Round (PCT)) + '% completed) ';
If DN <> Lastdir Then
Begin
DetailList.Items.Append (' Output directory: ' + DN ');
lastdir:= DN;
End
DetailList.Items.Append (' extract: ' + fn + ' (' + inttostr (Round (PCT)) + '% completed ');
Detaillist.itemindex: = detaillist.items.count-1;
End
Show Details complete
Modify the Unload file
Procedure curstepchanged (Curstep:tsetupstep);
Var
Uninspath, Uninsname, Newuninsname, myappname:string;
Begin
If Curstep=ssdone Then
Begin
Specify a new Uninstall file name (with no extension), modify it accordingly!
Newuninsname: = ' uninstall server ';
The application name, and the [SEUTP] segment of the AppName must be the same, please modify the corresponding!
Myappname: = ' service side ';
Rename the uninstall file below
uninspath:= Extractfilepath (Expandconstant (' {uninstallexe} '));
uninsname:= Copy (Extractfilename (Expandconstant (' {uninstallexe} ')), 1,8);
RenameFile (Uninspath + uninsname + '. exe ', Uninspath + newuninsname + '. exe ');
RenameFile (Uninspath + uninsname + '. Dat ', Uninspath + newuninsname + '. dat ');
Modify the appropriate registry content as follows
If Regkeyexists (HKEY_LOCAL_MACHINE, ' software\microsoft\windows\currentversion\uninstall\ ' + MyAppName + ' _is1 ') then
Begin
Regwritestringvalue (HKEY_LOCAL_MACHINE, ' software\microsoft\windows\currentversion\uninstall\ ' + MyAppName + ' _is1 ' , ' uninstallstring ', ' "' + Uninspath + newuninsname + '. exe ');
Regwritestringvalue (HKEY_LOCAL_MACHINE, ' software\microsoft\windows\currentversion\uninstall\ ' + MyAppName + ' _is1 ' , ' quietuninstallstring ', ' "' + Uninspath + newuninsname + '. exe"/silent ');
End
End
End
Inno setup scripts are often modified to go