inno setup多目录安装

 [Setup]

ShowLanguageDialog=yes
AppCopyright=版权所有(C) 2005, BitWorld Inc.
AppName={cm:License} {cm:Packagename}
AppVerName={cm:License} {cm:Packagename} {cm:Packagever}
LicenseFile=
OutputDir=E:/install
UninstallFilesDir={code:getmingwdir}/uninstall
ExtraDiskSpaceRequired=0
UserInfoPage=false
VersionInfoVersion=2.0
VersionInfoCompany=BitWorld Inc.
VersionInfoDescription=BitWorld
EnableDirDoesntExistWarning=true
AppID={{007F4590-89DE-4F87-9608-10F07CEFBBE9}
LanguageDetectionMethod=uilanguage
UsePreviousSetupType=true
DisableStartupPrompt=true
DirExistsWarning=no
WizardImageFile=D:/Program Files/Inno Setup 5/WizModernImage-IS.bmp
WizardSmallImageFile=D:/Program Files/Inno Setup 5/WizModernSmallImage-IS.bmp
OutputBaseFilename=Binutils-2.15-MingW32-Msys-setup
VersionInfoTextVersion=2.0
AppPublisher=heromyth
AppPublisherURL=http://www.donews.net/heromyth
AppVersion=1.0
AppContact=zxpmyth@yahoo.com.cn
UsePreviousTasks=false
UsePreviousAppDir=false
AllowRootDirectory=true
CreateAppDir=false

[Languages]
Name: en; MessagesFile: compiler:Languages/English.isl; LicenseFile: E:/install/gnu-readme-en-mingw32.txt
Name: chs; MessagesFile: compiler:Languages/ChineseSimp-11-5.1.0.isl; LicenseFile: E:/install/gnu-readme-zh-mingw32.txt
[Messages]
en.BeveledLabel=Created by Heromyth
chs.BeveledLabel=由张雪平创建
[Components]
Name: bininstall; Description: {cm:installBinFile}; Types: full compact; Flags: disablenouninstallwarning
Name: libinstall; Description: {cm:installLibFile}; Types: full; Flags: disablenouninstallwarning; Languages: 
[_ISTool]
OutputExeFilename=E:/install/Binutils-2.15-MingW32-Msys-setup.exe
[Files]
Source: dd/vv/logo_board.gif; DestDir: {code:getmingwdir}/vv/; Components: libinstall
Source: dd/33/logo_board.jpg; DestDir: {code:getmsysdir}/33/; Components: bininstall
Source: dd/33/cppunit-1.10.2.tar.gz; DestDir: {code:getmsysdir}/33/; Components: bininstall
Source: dd/ttt.bmp; DestDir: {code:getmsysdir}; Components: bininstall
[Dirs]
Name: {code:getmingwdir}/vv; Components: libinstall
Name: {code:getmsysdir}/33; Components: bininstall

[CustomMessages]
License=GNU
Packagename=Binutils
Packagever=2.15

en.installBinFile=install EXE files
chs.installBinFile=安装可执行文件
en.installLibFile=install LIB files
chs.installLibFile=安装库文件

en.choicedirCaption=Select Destination Location
chs.choicedirCaption=选择目标位置
en.choicedirDescription=Where should %1 be installed?
chs.choicedirDescription=你想将 %1 安装在什么地方?
en.SelectDirLabel=Setup will install %1 into the following folder.
chs.SelectDirLabel=安装程序将安装 %1 到下列文件夹中。
en.choicedir=Choice for installation directory of %1
chs.choicedir=选择%1的安装目录

en.SelectDirBrowseLabel=To continue, click Next. If you would like to select a different folder, click Browse.
chs.SelectDirBrowseLabel=单击“下一步”继续。如果您想选择其它文件夹,请单击“浏览”。
en.Button1Browse=&Browse...
chs.Button1Browse=浏览(&B)...
en.Button2Browse=B&rowse...
chs.Button2Browse=浏览(&R)...

en.msyslabel=(store something that run in Shell)
chs.msyslabel=(主要用于存放一些需要在Shell环境里使用程序及数据)
en.mingwlabel=(store something that run in win32 with mingw)
chs.mingwlabel=(主要用于存放一些需要在win32模式下使用的头文件和库)

en.installedDir=installation directory of %1
chs.installedDir=%1安装目录
[Code]
//Source: dd/cppunit-docs-1.10.2.tar.gz; DestDir: {code:getmsysdir}; Components: bininstall
//Source: dd/vv/headbg.jpg; DestDir: {code:getmingwdir}/vv/; Components: libinstall
var
  Mingwdir: TLabel;
  Msysdir: TLabel;
  BitmapImage1: TBitmapImage;
  Label1: TLabel;
  Label2: TLabel;
  Edit1: TEdit;
  Edit2: TEdit;
  Button1: TButton;
  Button2: TButton;
  NewStaticText1: TNewStaticText;
  NewStaticText2: TNewStaticText;

procedure ChoseMingwFoldersClick(Sender: TObject);
var
 choicedDIR:String;
begin
 if BrowseForFolder(ExpandConstant('{cm:choicedir,Mingw}'),choicedDIR,True) then
  Edit1.Text := choicedDIR;
end;

procedure ChoseMsysFoldersClick(Sender: TObject);
var
 choicedDIR:String;
begin
// if BrowseForFolder('选择Msys的安装目录',choicedDIR,True) then
 if BrowseForFolder(ExpandConstant('{cm:choicedir,Msys}'),choicedDIR,True) then
  Edit2.Text := choicedDIR+'/1.0';
end;

procedure choicedir_Activate(Page: TWizardPage);
begin
end;

function choicedir_ShouldSkipPage(Page: TWizardPage): Boolean;
begin
  Result := False;
end;

function choicedir_BackButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
end;

function choicedir_NextButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
end;

procedure choicedir_CancelButtonClick(Page: TWizardPage; var Cancel, Confirm: Boolean);
begin
end;

function choicedir_CreatePage(PreviousPageId: Integer): Integer;
var
  Page: TWizardPage;
begin
  Page := CreateCustomPage(
    PreviousPageId,
    ExpandConstant('{cm:choicedirCaption}'),
    ExpandConstant('{cm:choicedirDescription,{cm:Packagename}}')
  );

  { Mingwdir }
  Mingwdir := TLabel.Create(Page);
  with Mingwdir do
  begin
    Parent := Page.Surface;
    Left := ScaleX(0);
    Top := ScaleY(88);
    Width := ScaleX(24);
    Height := ScaleY(16);
//    Caption := 'Mingw安装目录'+ExpandConstant('{cm:NameAndVersion,fdd,1.0}') ;
    Caption := ExpandConstant('{cm:installedDir,Mingw}') ;
    Font.Color := -16777208;
    Font.Height := ScaleY(-13);
    Font.Name := 'Tahoma';
    Font.Style := [fsBold];
  end;

  { Msysdir }
  Msysdir := TLabel.Create(Page);
  with Msysdir do
  begin
    Parent := Page.Surface;
    Left := ScaleX(0);
    Top := ScaleY(160);
    Width := ScaleX(24);
    Height := ScaleY(16);
    Caption := ExpandConstant('{cm:installedDir,Msys}') ;
    Font.Color := -16777208;
    Font.Height := ScaleY(-13);
    Font.Name := 'Tahoma';
    Font.Style := [fsBold];
  end;

  { BitmapImage1 }
  BitmapImage1 := TBitmapImage.Create(Page);
  with BitmapImage1 do
  begin
    Parent := Page.Surface;
    Left := ScaleX(8);
    Top := ScaleY(8);
    Width := ScaleX(57);
    Height := ScaleY(41);
//Bitmap.LoadFromFile(BitmapFileName); 
  end;

  { Label1 }
  Label1 := TLabel.Create(Page);
  with Label1 do
  begin
    Parent := Page.Surface;
    Left := ScaleX(16);
    Top := ScaleY(136);
    Width := ScaleX(18);
    Height := ScaleY(13);
//    Caption := '(主要用于存放一些需要在win32模式下使用的头文件和库)';
    Caption := ExpandConstant('{cm:mingwlabel}');
    Color := -16777206;
    Font.Color := 32768;
    Font.Height := ScaleY(-12);
    Font.Name := 'Tahoma';
  end;

  { Label2 }
  Label2 := TLabel.Create(Page);
  with Label2 do
  begin
    Parent := Page.Surface;
    Left := ScaleX(16);
    Top := ScaleY(216);
    Width := ScaleX(18);
    Height := ScaleY(13);
//    Caption := '(主要用于存放一些需要在Shell环境里使用程序及数据)';
    Caption := ExpandConstant('{cm:msyslabel}');
    Font.Color := 32768;
    Font.Height := ScaleY(-12);
    Font.Name := 'Tahoma';
  end;

  { Edit1 }
  Edit1 := TEdit.Create(Page);
  with Edit1 do
  begin
    Parent := Page.Surface;
    Left := ScaleX(16);
    Top := ScaleY(112);
    Width := ScaleX(313);
    Height := ScaleY(21);
    TabOrder := 0;
    Text := 'C:/mingw';
  end;

  { Edit2 }
  Edit2 := TEdit.Create(Page);
  with Edit2 do
  begin
    Parent := Page.Surface;
    Left := ScaleX(16);
    Top := ScaleY(184);
    Width := ScaleX(313);
    Height := ScaleY(21);
    TabOrder := 1;
    Text := 'C:/MSYS/1.0';
  end;

  { Button1 }
  Button1 := TButton.Create(Page);
  with Button1 do
  begin
    Parent := Page.Surface;
    Left := ScaleX(336);
    Top := ScaleY(112);
    Width := ScaleX(75);
    Height := ScaleY(23);
    Caption :=ExpandConstant('{cm:Button1Browse}');
    TabOrder := 2;
    OnClick := @ChoseMingwFoldersClick;
  end;

  { Button2 }
  Button2 := TButton.Create(Page);
  with Button2 do
  begin
    Parent := Page.Surface;
    Left := ScaleX(336);
    Top := ScaleY(184);
    Width := ScaleX(75);
    Height := ScaleY(23);
    Caption := ExpandConstant('{cm:Button2Browse}');
    TabOrder := 3;
    OnClick := @ChoseMsysFoldersClick;
  end;

  { NewStaticText1 }
  NewStaticText1 := TNewStaticText.Create(Page);
  with NewStaticText1 do
  begin
    Parent := Page.Surface;
    Left := ScaleX(16);
    Top := ScaleY(16);
    Width := ScaleX(22);
    Height := ScaleY(17);
    Caption := ExpandConstant('{cm:SelectDirLabel,{cm:Packagename}}');
    Font.Color := -16777208;
    Font.Height := ScaleY(-13);
    TabOrder := 4;
  end;

  { NewStaticText2 }
  NewStaticText2 := TNewStaticText.Create(Page);
  with NewStaticText2 do
  begin
    Parent := Page.Surface;
    Left := ScaleX(16);
    Top := ScaleY(50);
    Width := ScaleX(22);
    Height := ScaleY(17);
//    Caption := '单击“下一步”继续。如果你想选择其它文件夹,请单击“浏览”。';
    Caption := ExpandConstant('{cm:SelectDirBrowseLabel,{cm:Packagename}}');
    Font.Color := -16777208;
  end;


  with Page do
  begin
    OnActivate := @choicedir_Activate;
    OnShouldSkipPage := @choicedir_ShouldSkipPage;
    OnBackButtonClick := @choicedir_BackButtonClick;
    OnNextButtonClick := @choicedir_NextButtonClick;
    OnCancelButtonClick := @choicedir_CancelButtonClick;
  end;

  Result := Page.ID;
end;

function getmingwdir(Param: String): String;
begin
 Result := Edit1.Text;
end;

function getmsysdir(Param: String): String;
begin
 Result := Edit2.Text;
end;

procedure InitializeWizard();
begin
  choicedir_CreatePage(wpUserInfo);
end;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值