How To install an OCX/DLL on the client's PC when needed ...

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,495
edited 2010-07-05 in How Tos section
How To install an OCX/DLL on the client's PC when needed (at run-time)?

http://www.mibuso.com/howtoinfo.asp?FileID=5

Discuss this How To here.

Comments

  • AnonymousAnonymous Guest Posts: 137
    Most users do not have sufficient permissions on their machine to run regsvr32 since it needs to write registry entries in the global registry. Does anyone know about a workaround/solution for this?

    /Bruno
  • AnonymousAnonymous Guest Posts: 137
    An easy way to solve this with any computers running XP. I found an application called RunAsUser. It's free and written by Palmersoft http://www.palmersoft.co.uk/runasuser.htm. It allows you to specify a script/batch/msi/executable file and the user/password/domain to be used. The program then creates a new exe file that you specify that contains the target file and encrypted logon credentials.

    Using the above method for installing OCX/DLL files, you could instead do what I have done and create a custom installer package to deploy and register them. Then, have Navision extract and run the installer.

    Now if you add the RunAsUser app to the mix, the only difference is that you would package your installer in the new exe and deploy that instead. The new exe in turn will unpack your exe and run it as the specified user. Pretty handy really.
  • pedwardpedward Member Posts: 11
    The code in the codeunit OCX/DLL Check/Import is bit old.
    Microsoft no longer support SHELL command with one parameter in 4+

    So you might have to break up SHELL command in 3 parameters.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Thx for the input. I'll make a revised edition of this How To.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • krikikriki Member, Moderator Posts: 9,094
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Dean_AxonDean_Axon Member Posts: 193
    Hi all;

    I am playing around with this code to make it work for us and I wanted to utilise this to check for an OCX being installed. My problem is this....

    in the function.
    fctIsOCXDLLInstalled(ptxtRegistryName : Text[100];ptxtVersion : Text[30]) : Boolean

    the following code is called:
    lrecAutServers.SETRANGE(Name,ptxtRegistryName);
    lrecAutServers.SETRANGE(Version,ptxtVersion);
    EXIT(lrecAutServers.FIND('-'));

    this works ok for the DLL file, but I want an OCX file which I can find in the "Custom Controls".

    My question.....

    How do I search through the custom controls, is there a system table for this ?

    Many Thanks in advance

    Dean
    Remember: Keep it simple
  • HanenHanen Member Posts: 281
    Hello,

    I have a dll wirtten in C#, I've did what you said but it didn't work, I've got this error message:


    Thanks for help!!!
    :oops:
    Regards

    Hanen TALBI
  • vaprogvaprog Member Posts: 1,116
    I do know very little about programming for .NET. If you need to register your dll, you might need to use regasm.exe instead of regsvr32.exe to register it, or you might have to implement self-registering functionality into your dll.
  • HanenHanen Member Posts: 281
    [Thanks, I'm using regasm and gacutil to register my dll. :thumbsup:
    Regards

    Hanen TALBI
Sign In or Register to comment.