InnoSetup静默脚本

#define MyAppName "我的程序"
#define MyAppVersion "1.5"
#define MyAppPublisher "我的公司"
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "222.txt"
 ;222.txt为安装后需要打开的文件名
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{9B4D1741-599A-480C-B600-584E211BED16}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\TETS
DefaultGroupName={#MyAppName}
;安装包保存的目录
OutputDir=C:\Users\Administrator\Desktop  
 ;安装包的文件名
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

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

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

 ;添加文件请加在以下的文件处
[Files]
Source: "E:\Test\222.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\Test\SQL.exe"; DestDir: "{app}"; Flags: ignoreversion
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
 [code]
[Code]
//关键代码静默安装
procedure InitializeWizard();
begin
  //不显示边框,这样就能达到不会闪两下了
  WizardForm.BorderStyle:=bsNone;
end; 
procedure CurPageChanged(CurPageID: Integer);
begin
 //因为安装过程界面隐藏不了,所以设置窗口宽高为0
  WizardForm.ClientWidth := ScaleX(0)
  WizardForm.ClientHeight := ScaleY(0)
if CurPageID = wpWelcome then
WizardForm.NextButton.OnClick(WizardForm);
if CurPageID >= wpInstalling then
    WizardForm.Visible := False
  else
    WizardForm.Visible := True;
 // WizardForm.NextButton.OnClick(WizardForm);
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
result := true;
end;
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent

分享题目:InnoSetup静默脚本
标题来源:http://bzwzjz.com/article/pediph.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站制作 网站设计制作报价 成都h5网站建设 重庆企业网站建设 成都网站制作 成都网站建设 成都品牌网站建设 教育网站设计方案 达州网站设计 成都网站建设公司 成都网站设计 定制网站设计 网站建设方案 外贸网站建设 营销型网站建设 成都网站制作 网站制作 成都网站制作 广安网站设计 高端网站设计推广 网站建设推广 手机网站制作设计