天高地厚

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

【转载】VB ActiveX插件开发打包部署一条龙服务

Posted on 2013-01-24 11:41  天高地厚-GNU  阅读(520)  评论(0编辑  收藏  举报
  • 创建ActiveX插件项目

New Project –> ActiveX UserControl

 

  • 编译成OCX文件

After your first build, set the project's "Version Compatibility" (Project -> <Project> Properties -> Component) to "Binary Compatibility" and select the OCX you created.

  • 使用Inno Setup制作安装文件

Tools:

http://www.jrsoftware.org/isdl.php

https://www.kymoto.org/inno-script-studio/download

http://www.jrsoftware.org/is3rdparty.php

http://www.jrsoftware.org/files/istrans/ChineseSimp-12/ChineseSimp-12-5.5.0.isl

Example of the setup script:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Web Finger Print Reader"
#define MyAppVersion "1.0"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{28798712-24CC-4241-9BB7-D2496C4C9C9B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin

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

[Files]
Source: "D:\Projects\FingerServerSideValidation.root\Finger\Finger.VB\Package2\Support\biokey.ocx"; DestDir: "{sys}"; Flags: restartreplace   noregerror   replacesameversion   uninsnosharedfileprompt   sharedfile ;
Source: "D:\Projects\FingerServerSideValidation.root\Finger\Finger.VB\Package2\Support\Project1.ocx"; DestDir: "{sys}"; Flags: restartreplace   noregerror   replacesameversion   uninsnosharedfileprompt   sharedfile ;
Source: "C:\Users\pcittsy\Downloads\reg.bat"; DestDir: "{app}";
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Run]
Filename:{app}\reg.bat;

;reg.bat contain regsvr32 command, for example:

;xcopy *.ocx %windir%\system32 /y

;regsvr project1.ocx /s

  • 使用WinCab制作CAB文件

Tools:http://www.xiazaiba.com/html/5264.html

Tips: The flash player activex is a good example, download swflash.cab, open it, you will find 2 files:

image

File swflash64.inf is very important, open it, the file content like this:

[Setup Hooks]
hook1=hook1

[hook1]
run=%EXTRACT_DIR%\FP_AX_CAB_INSTALLER64.exe

[Version]
; This section is required for compatibility on both Windows 95 and Windows NT.
Signature="$CHICAGO$"
AdvancedInf=2.0

So, add your setup.exe and swflash64.inf to your cab file, and remember, replace “FP_AX_CAB_INSTALLER64.exe to setup.exe”  in the inf file.

  • 使用SignTool为CAB文件签名

http://www.cnblogs.com/rushoooooo/archive/2011/06/22/2087542.html

 

  • 在Web页面上使用插件

Press F5 to run ActiveX project in Visual Basic 6 IDE, a web page will appear that loaded the ActiveX control, to view source code to see what the GUID is.

  • 插件版本更新

Build/Make the project again, and set the version number in the option dialog, republish ActiveX along with above steps.