innosetup制作静默安装包,安装后重启

; 脚本由 Inno Setup 脚本向导 生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!

[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{D77D24F4-27CA-4562-84AD-302F6A61337C}
AppName=我的程序
AppVersion=1.5
;AppVerName=我的程序 1.5
AppPublisher=我的公司
AppPublisherURL=http://www.example.com/
AppSupportURL=http://www.example.com/
AppUpdatesURL=http://www.example.com/
DefaultDirName={pf}\我的程序
DefaultGroupName=我的程序
;exe输出地址
OutputDir=C:\Users\Administrator\Desktop
;exe名
OutputBaseFilename=rgt
Compression=lzma
SolidCompression=yes
AlwaysRestart=yes


[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
;Source:文件源,DestDir:文件移动地址
[Files]
Source: "C:\Users\Administrator\Desktop\天津服务器维护文档.doc"; DestDir: "D:\"; Flags: ignoreversion
Source: "C:\Users\Administrator\Desktop\新建文件夹\319360.jpg"; DestDir: "C:\"; Flags: ignoreversion

; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”


[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;

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值