inno setup 安装 .net 服务

来源:互联网 发布:4g网络必须用4g手机吗 编辑:程序博客网 时间:2024/05/30 02:53

inno setup 脚本

#define MyAppName "getService"#define MyAppVersion "1.0"#define MyAppPublisher "AZ Studio"#define MyAppURL "http://sou.niceant.com"#define MyAppExeName "getService.exe"[Setup]; 注: AppId的值为单独标识该应用程序。; 不要为其他安装程序使用相同的AppId值。; (生成新的GUID,点击 工具|在IDE中生成GUID。)AppId={{4138D01D-3AC5-4180-9E7E-96FEB59CE393}AppName={#MyAppName}AppVersion={#MyAppVersion};AppVerName={#MyAppName} {#MyAppVersion}AppPublisher={#MyAppPublisher}AppPublisherURL={#MyAppURL}AppSupportURL={#MyAppURL}AppUpdatesURL={#MyAppURL}DefaultDirName={pf}\{#MyAppName}DefaultGroupName={#MyAppName}LicenseFile=E:\iDev\getBT\getBT\setup\publish\innosetup\program\license.txtOutputBaseFilename=setupCompression=lzmaSolidCompression=yes[Languages]Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"[Files];Source: "E:\iDev\getBT\getBT\setup\publish\innosetup\program\getService.exe"; DestDir: "{app}"; Flags: ignoreversionSource: "E:\iDev\getBT\getBT\setup\publish\innosetup\program\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”[Icons]Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"[Run]Filename: "{app}\installService.bat"; Description: "注册服务";Flags:runhidden[UninstallRun]Filename: "{app}\unstallService.bat";Flags:runhidden 

installService.bat

sc create "getService" binPath= "%~dp0getService.exe" start= autonet start "getService"

unstallService.bat

net stop "getService"sc delete "getService"

已在xp,win7下测试通过。

ikmb@163.com


原创粉丝点击