vb6 activex 文档项目静默安装

发布于 2024-09-12 18:44:05 字数 973 浏览 2 评论 0原文

我有一个 vb6 activex 文档项目,我需要创建一个无需任何用户界面和用户干预即可运行的 msi 包(这就是要求,因为它必须通过 Active Directory 进行部署)。我按照以下步骤操作:

  1. 我使用 Visual Studio 安装程序创建了一个 msi 项目,并删除了所有用户界面。手动将所有 vbd 文件添加到项目中,并编译它。当我运行 msi 时,它会在没有提示的情况下安装所有文件,但应用程序不会运行。

  2. 我使用包和部署向导创建了一个包,然后打开 vb pdw 项目的源代码,注释了所有消息框,并在需要时分配了默认值。然后编译setup.exe文件并用之前创建的安装包上的setup.exe复制/覆盖它。当我从像“setup.exe -s install.log”这样的命令提示符运行它时,它在没有提示的情况下安装了应用程序,运行良好。安装后应用程序运行良好。

  3. 因此,我决定使用 Visual Studio 2008 创建一个 msi 包,并添加上面创建的安装包(使用包和部署向导)。在自定义操作中,我将 setup.exe 设置为使用“-s install.log”参数运行。我需要一个保存应用程序路径的注册表项,因此我将其添加到注册表设置部分。

另一个要求是我需要在安装后运行另一个自解压的exe。该自解压程序将查看上述注册表项并提取(覆盖)应用程序路径上的文件。

因此,使用自定义操作,我将 update.exe 设置为在安装后运行。

现在,当我运行msi时,它运行良好,安装后运行update.exe,一切正常;但只是有时。我无法预测它何时有效,何时无效。当我在其他几台机器上尝试相同的 msi 时,它在某些机器上有效,但在其他机器上无效。 当我检查“添加或删除程序”时,有很多该应用程序的条目。

我在这个msi项目上挣扎了一段时间,现在感到很无助。我不知道我做错了什么。如果有人能指出我正确的方向,我将不胜感激。

还有其他方法可以在没有提示的情况下为 vb6 activex 文档项目创建安装包吗?

I have a vb6 activex document project and I need to create an msi package (thats what is the requirement since it has to be deployed thru active directory) that runs without any user interface and user intervention. I followed these steps:

  1. I created an msi project using visual studio installer and removed all the user interfaces. Added all the vbd files manually to the project, compiled it. When I run the msi, it intalls all the files without prompts but the application doesn't run.

  2. I created a package using package and deployment wizard, then opened the source code of vb pdw project, commented all the message boxes, assigned default values where required. Then compiled setup.exe file and copied/overwrote it with the setup.exe on the install package created earlier. When I run it from command prompt like this 'setup.exe -s install.log' it installed the application without prompts, works well. And the application runs well after installation.

  3. So I decided to create an msi package using visual studio 2008 and added the above created install package (using package and deployment wizard). In custom action I set the setup.exe to run with '-s install.log' arguments. I need one registry entry that holds the App path, so I added it on the registry settings section.

Another requirement is I need to run another self-extracting exe after the installation. And that self-extractor will look at the above registry entry and extracts (overwrites) the file on the App path.

So using custom action, I set the update.exe to run after the installation.

Now, when I run the msi, it runs well, and after installation it runs the update.exe, everything works well; but only sometimes. I couldn't predict when it works and when it doesn't. When I tried the same msi on few other machines, it worked on some and not on others.
And when I checked the 'Add or Remove programs' there were many entries for this App.

I have been struggling with this msi project for a while and now I feel helpless. I don't know what I'm doing wrong. I would appreciate if anyone could point me in the right direction.

Any other way to create an install package for vb6 activex document project without prompts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终难遇 2024-09-19 18:44:05

这对我使用 MSI 安装 ActiveX dll 文档有用:

这个回复有点晚了,但我也为此苦苦挣扎了大约
一年后才能开始工作。关键似乎是注册ActiveX
在另一台 PC 上安装时,可以使用 exe 或 dll。以下内容对我有用;我只是
列出 dll 的步骤,因为使用 exe 仍然没有 100% 成功:

  1. 创建您的 ActiveX dll 文档(您可以像 exe 一样使用 dll 形成表单)
  2. 使用 VB 打包和部署将必要的文件收集到一处。
    请务必使用安全的 VB 系统文件(从 http 下载其中的 zip 文件 [vb6sp6sys.zip] ://www.jrsoftware.org/iskb.php?vb) 代替那些
    由 VB 的打包和部署向导生成。
  3. 使用 VB 创建小型可执行文件(确保启动对象是
    Sub Main) 如下所示的代码部分。因为 Internet Explorer 是 ActiveX 文档的“容器”,所以这个小 exe 使用它的一个版本
    (IE) 加载 UserDocument1.vbd,具体取决于您使用的操作系统。 Windows 7 和 Vista(我认为是 Vista)默认使用不同版本的 IE,它似乎不想运行 ActiveX 文档。但是,在他们的 Program Files (x86) 中,有一个 IE 版本 - 因此会测试 (x86) 文件夹是否存在;如果不是,则假定这是较低版本的 Windows 并使用普通 IE 运行。将此小可执行文件命名为“SilentStartUp_ByOS.exe”
  4. 现在坏消息:您需要购买高级安装程序才能使用其专业版本,需要从其中提取注册信息
    DLL 的本机库和任何包含的 OCX。有免费版本
    高级安装程序,但它没有此功能。
    注意:可能还有其他安装包也可以执行此操作,但是
    高级安装程序是我所知道的唯一一个。我是 Inno 粉丝,但不能
    找到任何方法可以用 Inno 来做到这一点。
  5. 包含上面 2. 中的所有文件,以及 3. 中创建的 exe
    你的安装包。使用高级为 3. 中创建的 exe 分配图标
    安装程序并使其成为启动程序的快捷方式。
  6. 确保将所有内容安装在 AppDataFolder\AnyFolderNameHere 而不是 ProgramFilesFolder 中(使用“安装参数”屏幕)
    为了绕过Win7上非常严格的安全问题
    和 Vista,更不用说如果安装在公司内部网上了。

一切完成后,因为您的 dll 已注册,IE 应该能够
启动您的 ActiveX 文档。

代码:

Sub Main()

Dim strTemp As String
'ok, it may be Vista or Windows 7...
strTemp = "C:\Program Files (x86)\Internet Explorer\"
If CheckFileFolderExists(strTemp, False) = True Then
    'ok, use older version of IEXPLORE to run this on Win7 (or Vista)...
    Shell "C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE " & App.Path & "\UserDocument1.vbd", vbMaximizedFocus
Else
    Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE " & App.Path & "\UserDocument1.vbd", vbMaximizedFocus
End If

End Sub

Function CheckFileFolderExists(strName, fFile) As Boolean

' The fFile variable determines whether you're
' looking for a File (True) or Folder(False)
' The strName variable holds the fully qualified
' path you're looking for

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
  CheckFileFolderExists = False

  If fFile = True Then  ' It's a file

    If fso.FileExists(strName) = True Then
      CheckFileFolderExists = True
      Exit Function
    End If

  Else  ' It's a folder/directory

    If fso.FolderExists(strName) = True Then
      CheckFileFolderExists = True
      Exit Function
    End If

  End If

  Set fso = Nothing

End Function

This works for me using MSI to install an ActiveX dll document:

This reply is a bit late, but I also struggled with this for about
a year before getting it to work. The key seems to be in registering the ActiveX
exe or dll when installing on another PC. The following works for me; am only
listing steps for a dll as still haven't succeeded 100% with exes:

  1. Create your ActiveX dll Document (you can have forms with dll just like exe)
  2. Use VB Package and Deployment to gather the necessary files in one place.
    Be sure to use the safe VB system files (download a zip file [vb6sp6sys.zip] of them from http://www.jrsoftware.org/iskb.php?vb) in place of those
    generated by VB's Package and Deployment wizard.
  3. Use VB to create the small executable (make sure Startup Object is
    Sub Main) shown below in the code section. Because Internet Explorer is the "container" for your ActiveX document, this little exe uses a version of it
    (IE) to load your UserDocument1.vbd, DEPENDING ON WHICH OS you are using. Windows 7 and, I assume Vista, use a different version of IE by default, which doesn't seem to want to run an ActiveX document. But, in their Program Files (x86) there is a version of IE that will - hence the test on whether the (x86) folder exists or not; if not it assumes this is a lower version of Windows and runs using the normal IE. Call this small executable something like "SilentStartUp_ByOS.exe"
  4. Now the bad news: You need to buy Advanced Installer to use its Professional version, which is needed to extract the registration info from
    the native library of your DLL and any included OCXs. There is a free version
    of Advanced Installer, but it doesn't have this capability.
    Note: There may be other installation packages that will do this also, but
    Advanced Installer is the only one I know about. I'm an Inno fan, but couldn't
    find any way to do this with Inno.
  5. Include all the files from 2. above, along with the exe created in 3. in
    your Install package. Assign an icon to the exe created in 3. using Advanced
    Installer and make it a shortcut to start your program.
  6. Be sure to install everything (using the Install Parameters screen) in the AppDataFolder\AnyFolderNameHere instead of the ProgramFilesFolder
    for the sake of bypassing Security issues which are very strict on Win7
    and Vista, not to mention if installed on a company intranet.

When all is done, because your dll was registered, IE should be able
to start up your ActiveX document.

Code:

Sub Main()

Dim strTemp As String
'ok, it may be Vista or Windows 7...
strTemp = "C:\Program Files (x86)\Internet Explorer\"
If CheckFileFolderExists(strTemp, False) = True Then
    'ok, use older version of IEXPLORE to run this on Win7 (or Vista)...
    Shell "C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE " & App.Path & "\UserDocument1.vbd", vbMaximizedFocus
Else
    Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE " & App.Path & "\UserDocument1.vbd", vbMaximizedFocus
End If

End Sub

Function CheckFileFolderExists(strName, fFile) As Boolean

' The fFile variable determines whether you're
' looking for a File (True) or Folder(False)
' The strName variable holds the fully qualified
' path you're looking for

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
  CheckFileFolderExists = False

  If fFile = True Then  ' It's a file

    If fso.FileExists(strName) = True Then
      CheckFileFolderExists = True
      Exit Function
    End If

  Else  ' It's a folder/directory

    If fso.FolderExists(strName) = True Then
      CheckFileFolderExists = True
      Exit Function
    End If

  End If

  Set fso = Nothing

End Function
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文