Portability Error
-
I have compiled a program and made a install file. I have 3 dependencys to my program. I am working with .NET. The other computer has been updated to .net Architecture. One dependency is an .ocx file that i have installed into the windows directory. The .ocx is a user control that is been created in 6.0 and i am referencing to this. When i reference to this .ocx it makes 2 references. After i build the project. there are 2 dll's in the folder with my .exe. Thats fine. If you move the .ocx file out of the windows folder the app does not work. So i know that the app is looking for the .ocx file in the windows folder. Its just when i install this app on another machine it instant instantly says there has been an exception that can no be handled. Then i try the same install on my computer where i have made the 2 programs and it works fine. I just dont get it because all the files that are dependencys are there and the .ocx file is in its place when i run the install program. I just dont understand why it would not work on another machine with everything in its place with .net framework installed. Any help on this portability issue would be greatly appreciated. Thank you
-
I have compiled a program and made a install file. I have 3 dependencys to my program. I am working with .NET. The other computer has been updated to .net Architecture. One dependency is an .ocx file that i have installed into the windows directory. The .ocx is a user control that is been created in 6.0 and i am referencing to this. When i reference to this .ocx it makes 2 references. After i build the project. there are 2 dll's in the folder with my .exe. Thats fine. If you move the .ocx file out of the windows folder the app does not work. So i know that the app is looking for the .ocx file in the windows folder. Its just when i install this app on another machine it instant instantly says there has been an exception that can no be handled. Then i try the same install on my computer where i have made the 2 programs and it works fine. I just dont get it because all the files that are dependencys are there and the .ocx file is in its place when i run the install program. I just dont understand why it would not work on another machine with everything in its place with .net framework installed. Any help on this portability issue would be greatly appreciated. Thank you
When you place the .OCX files on the new machine, you have to register them with REGSVR32:
C:\\Windows>REGSVR32 _filename_.ocx
Once that is done, the OCX file CANNOT be moved, unless you unregister the .OCX and re-register it when it is in it's final position. This is because the full path to the .OCX file is stored in the registry so the system knows where to find the file when it needs it. Keep in mind, that .OCX files themselves, have dependencies. You must be sure that any .DLL files that the .OCX refers to are also copied to where the .OCX file expects them. You can use the
Depends
tool that comes with Visual Studio 6 to see what those dependencies are. You must also make sure that the dependent .DLL files are registered also, if they are ActiveX .DLL's. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -
When you place the .OCX files on the new machine, you have to register them with REGSVR32:
C:\\Windows>REGSVR32 _filename_.ocx
Once that is done, the OCX file CANNOT be moved, unless you unregister the .OCX and re-register it when it is in it's final position. This is because the full path to the .OCX file is stored in the registry so the system knows where to find the file when it needs it. Keep in mind, that .OCX files themselves, have dependencies. You must be sure that any .DLL files that the .OCX refers to are also copied to where the .OCX file expects them. You can use the
Depends
tool that comes with Visual Studio 6 to see what those dependencies are. You must also make sure that the dependent .DLL files are registered also, if they are ActiveX .DLL's. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -
Thanks that worked great but how could you do this through code to register it at machine that it installs on. And how could i the my program check to see if it is already registered with that machine. Thank you
It has to be done by the installer. Normaly, when you build an installer project (VB.NET) or use the Package and Deployment Wizard (VB6), this dependacy is handled for you, along with the registration of the .OCX. But, neither of these will take care of the dependancies that the .OCX file has. You'll have to add those manually. You'r app really can't check for the existance of the controls ahead of time. Your app would have to know the filename and version of each of the controls it needs, then it would have to check to see if the control is registered properly and that would require your app knowing all of the ClassID's the control registers. It's possible to do, but not worth the effort at all. Just making sure you have a properly packaged application is much easier. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome