一、模板代码

基本功能包括多路径安装、多语言、自定义图标。

[Setup]
ShowLanguageDialog=yes
AppCopyright=Copyright Reserved(C) , 360 Inc.
AppName={cm:Packagename}
AppVerName={cm:Packagename} {cm:Packagever}
LicenseFile=
OutputDir=C:/installer
UninstallFilesDir={code:getdlldir}/uninstall
ExtraDiskSpaceRequired=
UserInfoPage=false
VersionInfoVersion=1.0
VersionInfoCompany=360 Inc.
VersionInfoDescription=360
EnableDirDoesntExistWarning=true
AppID={{007F4590-89DE-4F87-9608-10F07CEFBBE9}
LanguageDetectionMethod=uilanguage
UsePreviousSetupType=true
DisableStartupPrompt=true
DirExistsWarning=no
WizardImageFile=C:/Users/zzk/Desktop/FILES/PR512.bmp
WizardSmallImageFile=C:/Users/zzk/Desktop/FILES/PR64.bmp
SetupIconFile=C:/Users/zzk/Desktop/FILES/PR32.ico
ArchitecturesAllowed=x64 ia64
OutputBaseFilename=win64_setup
VersionInfoTextVersion=1.0
AppPublisher=360 Inc.
AppPublisherURL=http://www.360.com
AppVersion=1.0
AppContact=zhangzhongke007@163.com
UsePreviousTasks=false
UsePreviousAppDir=false
AllowRootDirectory=true
CreateAppDir=false [Messages]
en.BeveledLabel=Created by 360 Inc.
chs.BeveledLabel=360荣誉出品
[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"; InfoBeforeFile: "readme-en.txt";
Name: "chs"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"; InfoBeforeFile: "readme-cn.txt";
[Components]
Name: dllall; Description: {cm:installDllFile}; Types: full; Flags: disablenouninstallwarning
Name: prmall; Description: {cm:installPrmFile}; Types: full; Flags: disablenouninstallwarning; Languages:
[_ISTool]
OutputExeFilename=C:/install/win64_setup.exe
[Files]
Source: ./avcodec-.dll; DestDir: {code:getdlldir}; Components: dllall
Source: ./avformat-.dll; DestDir: {code:getdlldir}; Components: dllall
Source: ./avutil-.dll; DestDir: {code:getdlldir}; Components: dllall
Source: ./custom.prm; DestDir: {code:getprmdir}; Components: prmall
[Dirs]
Name: {code:getdlldir}; Components: dllall
Name: {code:getprmdir}; Components: prmall [CustomMessages]
Packagename=360 desktop
Packagever=1.0. en.installDllFile=install dynamic link files
chs.installDllFile=安装动态库
en.installPrmFile=install Premiere Pro CC plugin files
chs.installPrmFile=安装插件文件 en.choicedirCaption=Select Destination Location
chs.choicedirCaption=选择安装路径
en.choicedirDescription=Where should % be installed?
chs.choicedirDescription=你想将%1安装到哪里呢?
en.SelectDirLabel=Setup will install % into the following folder.
chs.SelectDirLabel=安装程序将%1安装到如下位置
en.choicedir=Choice for installation directory of %
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.dlllabel=<The path to the system folders eg. C:/WINDOWS/System32>
chs.dlllabel=<系统目录如 C:/WINDOWS/System32>
en.prmlabel=<The plugin folder for Premiere Pro CC>
chs.prmlabel=<Premiere Pro CC公共插件目录> en.installedDir=installation directory of %
chs.installedDir=%1 的安装位置
[Code] var
Dlldir: TLabel;
Prmdir: TLabel;
BitmapImage1: TBitmapImage;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
NewStaticText1: TNewStaticText;
NewStaticText2: TNewStaticText; procedure ChoseDllFoldersClick(Sender: TObject);
var
choicedDIR:String;
begin
if BrowseForFolder(ExpandConstant('{cm:choicedir}'),choicedDIR,True) then
Edit1.Text := choicedDIR;
end; procedure ChosePrmFoldersClick(Sender: TObject);
var
choicedDIR:String;
begin
if BrowseForFolder(ExpandConstant('{cm:choicedir}'),choicedDIR,True) then
Edit2.Text := choicedDIR;
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 GetInstallString(): String;
var
sInstallPath: String;
begin
sInstallPath := 'C:\Program Files\Adobe\Common\Plug-ins\7.0\MediaCore';
if RegValueExists(HKLM64, 'SOFTWARE\Adobe\Premiere Pro\CurrentVersion', 'Plug-InsDir') then
begin
RegQueryStringValue(HKLM64, 'SOFTWARE\Adobe\Premiere Pro\CurrentVersion', 'Plug-InsDir', sInstallPath)
end
Result := sInstallPath;
end; function choicedir_CreatePage(PreviousPageId: Integer): Integer;
var
Page: TWizardPage;
begin
Page := CreateCustomPage(
PreviousPageId,
ExpandConstant('{cm:choicedirCaption}'),
ExpandConstant('{cm:choicedirDescription,{cm:Packagename}}')
); { Dlldir }
Dlldir := TLabel.Create(Page);
with Dlldir do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY(); Caption := ExpandConstant('{cm:installedDir,DLL}') ;
Font.Color := -;
Font.Height := ScaleY(-);
Font.Name := 'Tahoma';
Font.Style := [fsBold];
end; Prmdir := TLabel.Create(Page);
with Prmdir do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY();
Caption := ExpandConstant('{cm:installedDir,PRM}') ;
Font.Color := -;
Font.Height := ScaleY(-);
Font.Name := 'Tahoma';
Font.Style := [fsBold];
end; { BitmapImage1 }
BitmapImage1 := TBitmapImage.Create(Page);
with BitmapImage1 do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY();
end; { Label1 }
Label1 := TLabel.Create(Page);
with Label1 do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY(); Caption := ExpandConstant('{cm:dlllabel, DLLs}');
Color := -;
Font.Color := ;
Font.Height := ScaleY(-);
Font.Name := 'Tahoma';
end; { Label2 }
Label2 := TLabel.Create(Page);
with Label2 do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY(); Caption := ExpandConstant('{cm:prmlabel, PRMs}');
Font.Color := ;
Font.Height := ScaleY(-);
Font.Name := 'Tahoma';
end; { Edit1 }
Edit1 := TEdit.Create(Page);
with Edit1 do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY();
TabOrder := ;
Text := ExpandConstant('{sys}');
end; { Edit2 }
Edit2 := TEdit.Create(Page);
with Edit2 do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY();
TabOrder := ;
Text := GetInstallString();
end; { Button1 }
Button1 := TButton.Create(Page);
with Button1 do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY();
Caption :=ExpandConstant('{cm:Button1Browse}');
TabOrder := ;
OnClick := @ChoseDllFoldersClick;
end; { Button2 }
Button2 := TButton.Create(Page);
with Button2 do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY();
Caption := ExpandConstant('{cm:Button2Browse}');
TabOrder := ;
OnClick := @ChosePrmFoldersClick;
end; { NewStaticText1 }
NewStaticText1 := TNewStaticText.Create(Page);
with NewStaticText1 do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY();
Caption := ExpandConstant('{cm:SelectDirLabel,Insta360 Plugin}');
Font.Color := -;
Font.Height := ScaleY(-);
TabOrder := ;
end; { NewStaticText2 }
NewStaticText2 := TNewStaticText.Create(Page);
with NewStaticText2 do
begin
Parent := Page.Surface;
Left := ScaleX();
Top := ScaleY();
Width := ScaleX();
Height := ScaleY();
// Caption := 'µ¥»÷¡°ÏÂÒ»²½¡±¼ÌÐø¡£Èç¹ûÄãÏëÑ¡ÔñÆäËüÎļþ¼Ð£¬Çëµ¥»÷¡°ä¯ÀÀ¡±¡£';
Caption := ExpandConstant('{cm:SelectDirBrowseLabel,{cm:Packagename}}');
Font.Color := -;
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 getdlldir(Param: String): String;
begin
Result := Edit1.Text;
end; function getprmdir(Param: String): String;
begin
Result := Edit2.Text;
end; procedure InitializeWizard();
begin
choicedir_CreatePage(wpUserInfo);
end;

二、注意事项

需要注意的是,[Languages]这一节中的文件路径,Default.isl和ChineseSimplified.isl文件都是放在inno setup的安装目录下,放在其他目录中是找不到的。Default.isl默认的是英文版本,如果需要其他语言的翻译也好办,在官网上有很多网友贡献了翻译过的文本,下载下来放到inno setup安装目录下的Languages目录下即可。

一个简单的inno setup模板的更多相关文章

  1. 一个简单的Inno Setup例子

    ; 脚本由 Inno Setup 脚本向导 生成! ; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档! [Setup] ; 注: AppId的值为单独标识该应用程序. ; 不要为其 ...

  2. 分享一个自用的 Inno Setup 软件打包脚本

    此脚本支持打包mysql.安装mysql服务.安装windows服务.操作ini文件.操作注册表.高效压缩文件等功能,基本能满足常用的软件打包需求. ;定义各种常量 #define MyAppName ...

  3. C++一个简单的手柄类模板

    #ifndef HANDLE_H #define HANDLE_H #include "Animal.h" template <typename T> class Ha ...

  4. 一个简单的javaweb项目模板

    Controller包:表现层(视图)层.用来显示数据和接收用户数据 Service包:业务逻辑层,用来处理页面.先写接口,后写实现类 Dao包:持久层(数据访问层).用来操作数据库 其中Dao包处于 ...

  5. inno setup介绍及官方网站地址

    使 用 笔 记 1.Inno Setup 是什么?Inno Setup 是一个免费的 Windows 安装程序制作软件.第一次发表是在 1997 年,Inno Setup 今天在功能设置和稳定性上的竞 ...

  6. Inno Setup 使用笔记

    使 用 笔 记https://blog.csdn.net/dongshibo12/article/details/79095971 1.Inno Setup 是什么?Inno Setup 是一个免费的 ...

  7. Inno Setup 精灵显示插件 InnoFairy (V2.0 版本)

    原文 http://restools.hanzify.org/article.asp?id=111 一个如影随形的小精灵会令到你的安装程序更加人性化. 就是这样一个功能的Inno Setup插件, 希 ...

  8. 简单的Verilog测试模板结构

    这里记录一下曾经用到的简单的测试模板,如下所示: //timescale `timescale 1ns/1ns module tb_module(); //the Internal motivatio ...

  9. inno setup读取注册表遇到的一个坑

    一.背景 目前,公司针对PR开发的一个插件需要发布到64位系统上.该插件包括一个prm格式的文件和若干个DLL文件.其中,prm文件需要复制到PR公共插件目录下,DLL需要复制到Windows系统目录 ...

随机推荐

  1. SQL Server 2016中In-Memory OLTP继CTP3之后的新改进

    SQL Server 2016中In-Memory OLTP继CTP3之后的新改进 转译自:https://blogs.msdn.microsoft.com/sqlserverstorageengin ...

  2. 使用密码记录工具keepass来保存密码

    在第一章,曾经给过您建议,密码不要保存在文档中,那样不安全,如果密码很多而且又很复杂,人的大脑是不可能很容易记住的,只能记录下来,如果不能记在文档中那记在哪里呢?下面介绍给您一款记录密码的软件,使用. ...

  3. Kosaraju 算法检测有向图的强连通性

    给定一个有向图 G = (V, E) ,对于任意一对顶点 u 和 v,有 u --> v 和 v --> u,亦即,顶点 u 和 v 是互相可达的,则说明该图 G 是强连通的(Strong ...

  4. 手工给Meteor增加smart package的方法

    windows下无法装mrt(Meteor的包管理工具).不过还好smart package本身也就只是一个文件夹而已,不需要在Meteor中注册什么东西.所以直接把smart package扔到me ...

  5. Python yield与实现

    Python yield与实现  yield的功能类似于return,但是不同之处在于它返回的是生成器. 生成器 生成器是通过一个或多个yield表达式构成的函数,每一个生成器都是一个迭代器(但是迭 ...

  6. vue.js组件化开发实践

    前言 公司目前制作一个H5活动,特别是有一定统一结构的活动,都要码一个重复的轮子.后来接到一个基于模板的活动设计系统的需求,便有了下面的内容.借油开车. 组件化 需求一到,接就是怎么实现,技术选型自然 ...

  7. Sublime Text3 Package Control 在菜单栏中不显示

    前言 最近由于在 Sublime Text3 下配置了React 开发环境,最近也更新了Sublime Text3 的版本,由此装上了很多的插件.今天打开Sublime 想要通过 `Package C ...

  8. 如果用css的border属性画一个三角形

    假设页面中有个div,如何通过css做一个三角形.这是我们项目中用到的今天就稍微总结下.顺便说一句偷偷写博客的感觉还挺爽 div { width: 0; height: 0; border-top: ...

  9. 移动开发--Hybrid和Native混合开发-->HybridApp 、NativeApp、WebApp

    1.1.     APP三种开发模式 智能手机之普及不用多说,手机APP渗投到各个行业:电商(淘宝.京东等).金融(各手机行业.P2P借贷等).医疗(智慧医疗).交通(滴滴.Uber等).教育(慕课网 ...

  10. Android知识——ViewHolder的作用与用法

    ViewHolder通常出现在适配器里,为的是listview滚动的时候快速设置值,而不必每次都重新创建很多对象,从而提升性能.在android开发中Listview是一个很重要的组件,它以列表的形式 ...