How to get the path of the RoleTailored Client

sebastian_thiessebastian_thies Member Posts: 3
edited 2014-02-11 in NAV Tips & Tricks
Hi i know it's easy to get the path of the Classic Client with APPLICATIONPATH. But if you use this with RTC it returns the path of the Service-Tier. So how to get the path of the client?

Comments

  • deV.chdeV.ch Member Posts: 543
    You need the installation path of your rtc client?

    Maybe .net interop helps: http://msdn.microsoft.com/en-us/library/aa457089.aspx

    Be sure to set Property RunOnClient of your DotNet variable "Assembly" to True.
    GetClientPath() : Text
    EXIT(Path.GetDirectoryName(
      Assembly.GetExecutingAssembly().GetName().CodeBase
    ));
    

    Variables:
    Name DataType Subtype Length
    Assembly DotNet System.Reflection.Assembly.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    Path DotNet System.IO.Path.'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
  • sebastian_thiessebastian_thies Member Posts: 3
    Thanks for your reply, that works well.

    I was thinking about it a while and then I found my own working solution:

    Variables
    Name____DataType___Subtype_______Length
    WSH_____Automation_'Windows Script Host Object Model'.WshShell
    RegValues___Text____________________1024

    Code
    CREATE(WSH,FALSE,TRUE); //create automation on client
    RegValue := WSH.RegRead('HKEY_CLASSES_ROOT\DYNAMICSNAV\Shell\Open\Command\'); //find registrykey for navisionlink
    RegValue := COPYSTR(RegValue,1,STRLEN(RegValue)-5); // delete "%1" from text
    Exit(RegValue); // return path of the exe-file
    
  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from 'NAV Three Tier' forum to 'NAV/Navision Classic Client' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    deV.ch - Very clever, I will steal that. =D>
    Thanks a lot!!
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
Sign In or Register to comment.