论坛风格切换切换到宽版
  • 6690阅读
  • 11回复

[求助]Inno问题之CODE段界面按钮 [复制链接]

上一主题 下一主题
离线snakey
 
发帖
137
金钱
0
威望
0
只看楼主 倒序阅读 0 发表于: 2005-09-18
如帖子末尾的图,以前可以在最左下角附近增加一个“关于”按钮,并且点击能弹出一个对话框,对话框内内容可以自定,还有一种办法就是直接可以在按钮旁边显示一段连接字符串,点击后能打开浏览器到指定页面。以前做过后来Inno更新到5。X后就不行了。
谁能改一下代码?
CODE

[Code]
procedure AboutButtonOnClick(Sender: TObject);
begin
 MsgBox('这个安装程序是绿色安装程序,无访问Internet组件,不写入注册表信息。', mbInformation, mb_Ok);
end;

procedure URLLabelOnClick(Sender: TObject);
var
 Dummy: Integer;
begin
 InstShellExec('http://www.ray-sky.net', '', '', SW_SHOWNORMAL, Dummy);
end;

procedure InitializeWizard();
var
 AboutButton, CancelButton: TButton;
 URLLabel: TNewStaticText;
 BackgroundBitmapImage: TBitmapImage;
 BackgroundBitmapText: TNewStaticText;
begin
 CancelButton := WizardForm.CancelButton;

 AboutButton := TButton.Create(WizardForm);
 AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;
 AboutButton.Top := CancelButton.Top;
 AboutButton.Width := CancelButton.Width;
 AboutButton.Height := CancelButton.Height;
 AboutButton.Caption := '关于(&A)...';
 AboutButton.OnClick := @AboutButtonOnClick;
 AboutButton.Parent := WizardForm;

 URLLabel := TNewStaticText.Create(WizardForm);
 URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
 URLLabel.Left := AboutButton.Left + AboutButton.Width + 20;
 URLLabel.Caption := 'www.ray-sky.net';
 URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderLine];
 URLLabel.Font.Color := clBlue;
 URLLabel.Cursor := crHand;
 URLLabel.OnClick := @URLLabelOnClick;
 URLLabel.Parent := WizardForm;

 BackgroundBitmapImage := TBitmapImage.Create(MainForm);
 BackgroundBitmapImage.AutoSize := True;
 BackgroundBitmapImage.Bitmap := WizardForm.WizardBitmapImage.Bitmap;
 BackgroundBitmapImage.Left := 50;
 BackgroundBitmapImage.Top := 100;
 BackgroundBitmapImage.Parent := MainForm;

 BackgroundBitmapText := TNewStaticText.Create(MainForm);
 BackgroundBitmapText.Caption := 'TBitmapImage';
 BackgroundBitmapText.Left := BackGroundBitmapImage.Left;
 BackgroundBitmapText.Top := BackGroundBitmapImage.Top + BackGroundBitmapImage.Height + 8;
 BackgroundBitmapText.Parent := MainForm;
end;

User Posted Image
离线restools

发帖
2848
金钱
1430
威望
143
只看该作者 1 发表于: 2005-09-18
QUOTE
procedure URLLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', 'http://www.ray-sky.net', '', '', SW_SHOW, ewNoWait, ErrorCode)
end;
我的BLOG:   http://restools.hanzify.org (Inno Setup 增强版, 插件 发布站点)
离线snakey
发帖
137
金钱
0
威望
0
只看该作者 2 发表于: 2005-09-18
URLLabel并不显示出来~另外谁知道按钮怎么做?
离线zhansh

发帖
1058
金钱
10
威望
1
只看该作者 3 发表于: 2005-09-18
将 restools 修改的代码替换你楼顶的代码后,在 INNO 515 中测试通过,标签显示和按钮功能都没有问题。
离线snakey
发帖
137
金钱
0
威望
0
只看该作者 4 发表于: 2005-09-18
= =麻烦把你的代码贴出来。反正楼顶那段原文是不能编译的。
离线zhansh

发帖
1058
金钱
10
威望
1
只看该作者 5 发表于: 2005-09-18
CODE
[Setup]
AppName=我的程序
AppVerName=我的程序 1.5
AppPublisher=我的公司
AppPublisherURL=http://www.mycompany.com
AppSupportURL=http://www.mycompany.com
AppUpdatesURL=http://www.mycompany.com
DefaultDirName={pf}\我的程序
DefaultGroupName=我的程序
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Languages]
Name: "chi"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; 注意: 不要在任何共享系统文件中使用“Flags: ignoreversion”

[Icons]
Name: "{group}\我的程序"; Filename: "{app}\MyProg.exe"
Name: "{userdesktop}\我的程序"; Filename: "{app}\MyProg.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\MyProg.exe"; Description: "{cm:LaunchProgram,我的程序}"; Flags: nowait postinstall skipifsilent

[Code]
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('这个安装程序是绿色安装程序,无访问Internet组件,不写入注册表信息。', mbInformation, mb_Ok);
end;

//*********** restools 写的很清楚啊,就是换掉这一段***********
procedure URLLabelOnClick(Sender: TObject);
var
 ErrorCode: Integer;
begin
 ShellExec('open', 'http://www.ray-sky.net', '', '', SW_SHOW, ewNoWait, ErrorCode)
end;
//*****************************************************

procedure InitializeWizard();
var
AboutButton, CancelButton: TButton;
URLLabel: TNewStaticText;
BackgroundBitmapImage: TBitmapImage;
BackgroundBitmapText: TNewStaticText;
begin
CancelButton := WizardForm.CancelButton;

AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;
AboutButton.Top := CancelButton.Top;
AboutButton.Width := CancelButton.Width;
AboutButton.Height := CancelButton.Height;
AboutButton.Caption := '关于(&A)...';
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := WizardForm;

URLLabel := TNewStaticText.Create(WizardForm);
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + 20;
URLLabel.Caption := 'www.ray-sky.net';
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderLine];
URLLabel.Font.Color := clBlue;
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := WizardForm;

BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.AutoSize := True;
BackgroundBitmapImage.Bitmap := WizardForm.WizardBitmapImage.Bitmap;
BackgroundBitmapImage.Left := 50;
BackgroundBitmapImage.Top := 100;
BackgroundBitmapImage.Parent := MainForm;

BackgroundBitmapText := TNewStaticText.Create(MainForm);
BackgroundBitmapText.Caption := 'TBitmapImage';
BackgroundBitmapText.Left := BackGroundBitmapImage.Left;
BackgroundBitmapText.Top := BackGroundBitmapImage.Top + BackGroundBitmapImage.Height + 8;
BackgroundBitmapText.Parent := MainForm;
end;
离线snakey
发帖
137
金钱
0
威望
0
只看该作者 6 发表于: 2005-09-18
寒,奇怪了,这次能编译了。。。。难道偶漏掉了;号?
离线coolgas

发帖
2067
金钱
70
威望
7
只看该作者 7 发表于: 2005-09-18
里面的MM是哪部动画里面的啊?
摆过地摊、玩过汉化、做过美工,至今未婚...
http://coolgascn.ys168.com/
离线snakey
发帖
137
金钱
0
威望
0
只看该作者 8 发表于: 2005-09-18
= =不是动画的,和你的头像shuffle的芙蓉枫一样出自西又葵之手。
离线coolgas

发帖
2067
金钱
70
威望
7
只看该作者 9 发表于: 2005-09-19
EASI 在官方找到 CS1.6 3147 版本 楼主的3248 是自己改的?
摆过地摊、玩过汉化、做过美工,至今未婚...
http://coolgascn.ys168.com/