#define MyAppName "Somarto"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "XXXXXX有限公司"
#define MyAppURL "http://www.XXX.cn/"
#define MyAppExeName "Somarto.exe"
#define MyAppRegUninstall "Software\Microsoft\Windows\CurrentVersion\Uninstall\"
[Setup]
AppId={{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}
AppName={#MyAppName}{#MyAppVersion}
AppVerName={#MyAppName}{#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\Somarto
VersionInfoCopyright=Copyright @ 2011 -2018 XXX. All Rights Reserved
DefaultGroupName={#MyAppName}
OutputDir=D:\CKM\Somarto\setup
OutputBaseFilename=Somarto-64
SetupIconFile=D:\CKM\Somarto\style\dns32.ico
Compression=lzma
SolidCompression=yes
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
[Languages]
;Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
;Name: "english"; MessagesFile: "compiler:Languages\English.isl"
Name: "englishsimp"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone;
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone

[Files]
Source: "D:\CKM\Somarto\bin\Debug\Somarto.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\SomartoGame.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Coding4Fun.Kinect.WinForm.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Coding4Fun.Kinect.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Fleck.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\FluorineFx.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Fx.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Somarto.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Kinect.Services.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Kinect.Toolbox.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\log4net.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\log4net.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\sys.ini"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\style\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "*.*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs; BeforeInstall: ChangeDisplay
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Registry]
Root: HKLM; Subkey: "software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Somarto"; ValueData: "{app}\Somarto.exe"; Flags: uninsdeletevalue
;Root: HKLM; Subkey: "software\Somarto"; ValueType: string; ValueName: "Install"; ValueData: "{app}"; Flags: uninsdeletevalue
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}"; ValueType:string;ValueName:"UninstallString";ValueData:"{app}\unins000.exe" ; Flags:uninsdeletekey
[Code]
var
hasRun:HWND;
resultCode: Integer;
resultStr:String;
function InitializeSetup(): Boolean;
begin
Result := True;
begin
if RegKeyExists(HKLM, '{#MyAppRegUninstall}{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}_is1') then
begin
if MsgBox('安装程序检测到【Somarto】的一个版本已安装。'#13#10'选择“是”将覆盖安装。'#13#10'选择“否”退出安装程序,放弃安装。', mbConfirmation, MB_YESNO) = IDYES then
begin
hasRun := FindWindowByWindowName('Somarto');
while (hasRun <> 0) do
begin
MsgBox('【Somarto】的一个版本正在运行,'#13#10'应用程序将自动退出。',mbConfirmation, MB_OK);
PostMessage(hasRun,18,0,0);
Sleep(3);
hasRun :=0;
end;
Result := True;
end else
begin
Result := False;
exit;
end;
end;
end;

begin
if RegQueryStringValue(HKLM, '{#MyAppRegUninstall}{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}_is1', 'UninstallString', ResultStr) then
begin
ResultStr := RemoveQuotes(ResultStr);
Exec(resultStr, '/VERYSILENT', '', SW_HIDE, ewWaitUntilTerminated, resultCode);
end;
end;

end;

procedure InitializeWizard();
begin
begin
WizardForm.WizardSmallBitmapImage.Top := ScaleY(0);
WizardForm.WizardSmallBitmapImage.Left := ScaleX(0);
WizardForm.WizardSmallBitmapImage.Width := WizardForm.MainPanel.Width;
WizardForm.WizardSmallBitmapImage.Height := WizardForm.MainPanel.Height;
WizardForm.PageNameLabel.width:=40; //设置标题文字显示的大小
WizardForm.PageDescriptionLabel.width:= 230; //设置标题文字显示的大小

end;
end;

function InitializeUninstall(): Boolean;
begin
begin
hasRun := FindWindowByWindowName('Somarto');
if hasRun<>0 then
begin
MsgBox('【Somarto】应用程序正在运行。' #13#10 '请先退出您的应用程序,然后再进行卸载。', mbInformation, MB_OK);
Result := false;
exit;
end;
end;
begin
DelTree(ExpandConstant('{app}'), True, True, True);
RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, 'Software\icc');
end;
Result := true;
end;

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

最新文章

  1. PHP同时上传“多个”文件示例,并格式化$_FILES数组信息
  2. JS脚本收藏(一些实用的函数)
  3. 因为此控件已在 web.config 中注册并且与该页位于同一个目录中
  4. PetShop的系统架构设计
  5. mmm hardware/libhardware_legacy/power/
  6. uva387 - A Puzzling Problem
  7. Binding to the Most Recent Visual Studio Libraries--说的很详细,很清楚
  8. loadrunner_analysis技巧_average 和 90% percent
  9. Mysql常见问题及优化
  10. install samba on crux without net.
  11. 深入理解Spring Redis的使用 (九)、通过Redis 实现 分布式锁 的 BUG,以及和数据库加锁的性能测试
  12. gat和post封装代码
  13. 未来-区块链-Micron:区块链永远不会忘记:内存对这项革命性技术的推动作用
  14. POJ2456Aggressive cows-(二分判定)
  15. Hybris CronJob.
  16. 【算法】DP解决旅行路径问题
  17. 基于duxshop遍历无限级分销用户的纵向递归
  18. Oracle 11g 数据库 shutdown 后立即执行 startup mount 报错的解决办法
  19. Windows消息队列一
  20. 利用 Python 插件 xlwings 读写 Excel

热门文章

  1. YII框架分析笔记2:组件和事件行为管理
  2. Android之文件搜索工具类
  3. JUnit4单元测试入门教程
  4. Lp空间
  5. [Link]Hive资料整理
  6. kafka-python的gevent模式和kafka的兼容性
  7. JavaScript:RegExp 对象
  8. 样条之埃尔米特(Hermite)
  9. 7.1 服务暴露前的准备-ServiceBean的装配
  10. [leetcode]Interleaving String @ Python