inno setup打包应用程序
使用创建向导
生成脚本
#define MyAppName "back" #define MyAppVersion "1.5" #define MyAppPublisher "我的公司" #define MyAppURL "http://www.example.com/" #define MyAppExeName "MyProg.exe" [Setup] ; 注: AppId的值为单独标识该应用程序。 ; 不要为其他安装程序使用相同的AppId值。 ; (生成新的GUID,点击 工具|在IDE中生成GUID。) AppId={{A30CC69D-E4F5-46D2-A4A2-58B557BC6ACA} AppName={#MyAppName} AppVersion={#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName={pf}\{#MyAppName} DefaultGroupName={#MyAppName} OutputBaseFilename=bak 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: "C:\Program Files\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\cron\back.bat"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\cron\back_add.bat"; DestDir: "{app}"; Flags: ignoreversion ; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion” [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon ;自动运行加载 [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent ;自动运行bat脚本 Filename:"{app}\back_add.bat"; Flags: nowait runhidden;编译即可。