博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

(inno setup)ocx/dll注册代码

Posted on 2012-07-17 09:41  hyruur  阅读(1021)  评论(0编辑  收藏  举报

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
;Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]                                                              
Source: "chysoftPrinter.dll"; DestDir: "{app}"; Flags: ignoreversion regserver;
Source: "chysoftPrinter.dll"; DestDir: "{app}"; Flags: regtypelib;   
Source: "chysoftPrinter.inf"; DestDir: "{app}"; Flags: ignoreversion;  

;拷贝文件到 C:\Windows\system32下
Source: "chysoftPrinter.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: restartreplace sharedfile; 

;拷贝文件到 C:\Windows\Downloaded Program Files下

Source: "chysoftPrinter.dll"; DestDir: "{win}\Downloaded Program Files"; CopyMode: alwaysskipifsameorolder; Flags: restartreplace sharedfile;
Source: "chysoftPrinter.inf"; DestDir: "{win}\Downloaded Program Files"; CopyMode: alwaysskipifsameorolder; Flags: restartreplace sharedfile;
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
;Name: "{group}\ChySoft个人信息管理系统打印控件"; Filename: "{app}\chysoftPrinter.dll"
;Name: "{commondesktop}\ChySoft个人信息管理系统打印控件"; Filename: "{app}\chysoftPrinter.dll"; Tasks: desktopicon

[Run]
Filename: "{app}\chysoftPrinter.inf"; Description: "{cm:LaunchProgram,ChySoft个人信息管理系统打印控件}"; Flags: shellexec postinstall skipifsilent

[code]
//删除所有配置文件以达到干净卸载的目的
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then
    if MsgBox('请确认已退出IE,是否同意删除IE中关于本打印控件的相关文件?', mbConfirmation, MB_YESNO) = IDYES then
    //删除 {app} 文件夹及其中所有文件
     DeleteFile(ExpandConstant('{win}\Downloaded Program Files\chysoftPrinter.dll'));
     DeleteFile(ExpandConstant('{win}\Downloaded Program Files\chysoftPrinter.inf'));
end;
[/code]