Skip to main content
1-Visitor
September 30, 2020
Question

Is their any way to Run creo C++ ToolKit plugin without loading creotk.dat

  • September 30, 2020
  • 3 replies
  • 4839 views

Hey, I am developing a C++ Toolkit plugin,  but I don`t not want to load creotk.dat manually in config.pro or even in Aux Applications. Is their any way to alternative method to do that.

3 replies

15-Moonstone
September 30, 2020
  • There are 5 registry file directories as known will be searched by Creo Parametric automatically when startup:
A. C:\ProgramData\PTC\Creo4\Plugins\<any sub folder>\
B. Working Directory
C. <Creo Parametric installation folder>\Common Files\<machine type>\text\<language>\
D. <Creo Parametric installation folder>\Common Files\text\
E. <Creo Parametric installation folder>\Common Files\text\<language>\
  • The searching order is: A->B->C->D->E, and Creo Paretric will stop searching if protk.dat / creotk.dat is found in B,C,D or E
e.g. if protk.dat exist in A,B,C,D,E separately, protk.dat in A will be loaded first then protk.dat in B, then Creo Parametric stop searching
21-Topaz I
June 20, 2022
21-Topaz I
October 5, 2020

To address properly your request, there is a need to clarify why you need to run an application witout creotk.dat. 

 

What is the purpose of opting for a different route than the official one?

October 7, 2020

@remy wrote:

To address properly your request, there is a need to clarify why you need to run an application witout creotk.dat. 

 

What is the purpose of opting for a different route than the official one?

 

 


my guess the purpose of opting for a different route is that the official route with the exception of option B in Mark's answer requires executing installation scripts with elevated permissions and in case B,C,D,E there is quite high probability that creotk.dat would be misconfigured in case of multiple applications from multiple vendors.

 

A. C:\ProgramData\PTC\Creo4\Plugins\<any sub folder>\
     for the custom app installation script this is environment variable LOCALAPPDATA evaluated in 'All Users' content as such ${LOCALAPPDATA}\PTC...
     this folder is usually is read-only for non-privileged user and would require an assistance from IT to install a registry file there...
B. Working Directory  (STARTUP directory)
    for the installation script this is unknown entity. Either script needs to prompt an end user for the directory location - thus no silent install. Alternatively script could search computer mounted drives for clues - this is not good either.
   if there was an existing creotk.dat file in  than a special care needs to be taken to append the relevant entries instead of overriding the existing one...
 
 
C. <Creo Parametric installation folder>\Common Files\<machine type>\text\<language>\
D. <Creo Parametric installation folder>\Common Files\text\
E. <Creo Parametric installation folder>\Common Files\text\<language>\
       all of those  locations most likely will require elevated privileges to either write new file there or alter the existing one.
       because only one creotk.dat from those locations is read in - this becomes a recipe  for disaster when multiple vendors are trying to place their registry data there.
       all of those location would force installation script to answer the question - which existing creotk.dat file to alter...
      all of those locations would need an installation script to access HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PTC... computer registry setting in order to figure out <Creo installation folder>. This also most likely would require elevated permissions.
 
      not to mention when new maintenance release would be installed the migration of creotk.dat file has to happen and quite often it would not happen without sysadmin intervention - not good either...
 
  
 
 
    
15-Moonstone
October 7, 2020

And looking at the original question, you don't have to load creotk.dat at all.  Fact is you can load any named.dat file from any location.   In the config.pro, you can set PROTKDAT FILELOCATION\NAME.DAT.  (Im using Creo3, the Protkdat config.pro setting could be called creotkdat in newer versions).

Anyway the entry in Creo 3 looks like:

PROTKDAT J:\MYTOOLKITSTUFF\MYTK.DAT

 

October 5, 2020

maybe a call to ProToolkitDllLoad(). 

21-Topaz I
October 8, 2020

When you read the documentation, it tells that this function calls another application.
This still requires that the calling application be started with a creotk.dat file.

October 8, 2020

reading the documentation...

  • Pro/Toolkit or OTK asynchronous application does not need a registry file to start.
  • Web/Link application does not need a registry file to start.
  • J-Link asynchronous application does not need a registry file to start.
  • J-Link attached to Pro/Program does not need a registry file to start.

 

Pro/Toolkit, OTK, Web/Link, OTK-Java (J-link) user guides, all of them have 'Task Based Application Libraries' chapter.

start an async app, make it call  pfcSession.BaseSession.LoadProToolkitDll(...) or ProToolkitDllLoad(...), exit async app.