如何创建包括mysql-ODBC,所有DLL和OCX文件的Windows可移植应用程序? [英] How do I create a Windows portable app including mysql-ODBC, all DLL- and OCX-files?

查看:140
本文介绍了如何创建包括mysql-ODBC,所有DLL和OCX文件的Windows可移植应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用vb6编程的应用程序,需要在Windows 7中安装一些dll文件和ocx文件。



我已经有一个使用 innosetup ,其中包括所有必需的文件,并安装了适用于Windows(x86,64位)的MySQL Connector-ODBC



如果我只是将所有文件放到一个文件夹中,则安装确实可以正常工作,则会出现错误


组件MSDATGRD.OCX或一个的依赖项未正确注册:文件丢失或无效


我尝试搜索 msdatgrd.ocx Portableapp 但没有想法



是否有简单的解决方法使该应用程序无需安装即可运行?



您可以下载我想打包到PortableApp中的文件此处






我尝试使用依赖行者打开Setup.exe,但是很遗憾,我没有足够的专业知识来使用该工具。 此处是屏幕截图



尽管Dependency Walker的输出似乎具有欺骗性,请参见此处:


Win 7、64位,dll问题


无论如何:我在此处打包了,现在它显示了其他更多文件的丢失:pastebin.com/8LawEbuk 7这似乎导致任何地方,因为依赖项遍历器太旧了






我正在寻找创建起来非常简单的东西,无论文件的大小到底是多少,因为我不是Windows程序员

解决方案

以下错误:



< blockquote>

复合nent MSDATGRD.OCX或其依赖项之一未正确注册
:文件丢失或无效


可能是因为您尚未注册ocx组件。如果您要手动分发此组件,则还需要在用户的计算机中注册它。为此,请发出以下命令:



regsvr32 msdatgrd.ocx (请注意,拥有管理员权限。)



如果您不想在典型的应用程序目录(即C:\Program Files)中安装应用程序,则可以使用% APPDATA%或%LOCALAPPDATA%变量分别获取Romaming(如果在网络上)和本地用户的应用程序目录。您也可以使用Windows API来做到这一点。例如:

  if(SUCCEEDED(SHGetFolderPath(NULL,CSIDL_COMMON_APPDATA,NULL,0,szPathName)))
{
PathAppend(szPathNam,_L \\YourCompany\\YourProduct\\));
}

除了.ocx(它是实现特定接口的Dll)之外,请注意,如果您使用在setup.exe内编写的DLL中的其他方法,则必须将其导出。下面的不错的文章:



http://msdn.microsoft.com/zh-cn/library/z4zxe9k8.aspx



http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes -from-a-DLL



c ++导出和使用dll函数



编辑:



我发现了:



使用OCX而不进行注册



请注意,Windows XP将于2014年4月停产!!另请注意,这样做是一个肮脏的技巧,应避免。我不知道在Windows 7和Windows 8上会发生什么(老实说,您不应该花很多时间在玩弄技巧,而要更改为便携式dll组件)



关于 http://boxedapp.com/
我从没用过,但是值得一看。 / p>

I have an application, programmed in vb6 that needs some dll-files and ocx-files installed in windows 7.

I already have an installer created with innosetup that includes all needed files and also installs the mysql Connector-ODBC for Windows (x86, 64-bit)

If I just put all files into one folder the installation doesent work, I get the error

Component MSDATGRD.OCX or one of its dependencies not correctly registered: a file is missing or invalid

I tried a search for msdatgrd.ocx portableapp but no Idea

Is there an easy workaround to make this app running without installation?

You can download the files I want to pack into a PortableApp here.


I tried opening the Setup.exe with dependency walker, but unfortunately I have not enough expertise to use that tool. here a screenshot

Although the output of dependency walker seems to be deceptive, see here:

Win 7, 64 bit, dll problems

anyway: I downloaded those 9 files here and packed them , now it shows even more other files missing: pastebin.com/8LawEbuk 7 this doesent seem to lead anywhere cause the dependency walker is too old


I am looking for something really simple to create, no matter the filesize in the end, as I am not a windows programmer

解决方案

The error below:

Component MSDATGRD.OCX or one of its dependencies not correctly registered: a file is missing or invalid

is probably because you haven't registered the ocx component. If you are manually distributing this component, then you also need to register it in the user's machine. To do so you issue the following command:

regsvr32 msdatgrd.ocx from the command line (note that you need to have admin rights).

If you don' want to install the application in a typical application directory (i.e.: C:\Program Files) you can use the %APPDATA% or %LOCALAPPDATA% variables to get Romaming (if on a network) and Local user's application directory, respectively. You can also use Windows API to do that. For example:

if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, szPathName)))
{
    PathAppend(szPathNam, _L"\\YourCompany\\YourProduct\\") );
}

Besides the .ocx (which is a Dll that implements specific interfaces), you should note that if you use other methods from a DLL you wrote inside your setup.exe then you have to export them. Nice articles below:

http://msdn.microsoft.com/en-us/library/z4zxe9k8.aspx

http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL

c++ exporting and using dll function

EDIT:

I found this:

Use OCX without registering it

Be aware the Windows XP will be descontinued in April 2014!! Also note that doing this is a dirty hack and should be avoided. I don't know what happens on Windows 7 and Windows 8 (honestly you shouldn't spend time with tricks, but changing to a portable dll component)

Also I heard about http://boxedapp.com/ I've never used but it worth a look.

这篇关于如何创建包括mysql-ODBC,所有DLL和OCX文件的Windows可移植应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆