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

AdministratorAdministrator Posts: 2,436Member, Moderator, Administrator
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 Posts: 137Guest
    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 Posts: 137Guest
    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 Posts: 11Member
    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 AartselaarPosts: 3,632Member, Moderator, Administrator
    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. || Search is your friend
    NAV TechDays 2019: 21 & 22 November 2019, Antwerp (Belgium)
  • krikikriki Posts: 8,720Member, Moderator
    Regards,Alain Krikilion
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
    NAV TechDays 2019: 21 & 22 November 2019, Antwerp (Belgium)
  • Dean_AxonDean_Axon Posts: 188Member
    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 Posts: 281Member
    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 Posts: 875Member
    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 Posts: 281Member
    [Thanks, I'm using regasm and gacutil to register my dll. :thumbsup:
    Regards

    Hanen TALBI
Sign In or Register to comment.