Hi,
You have access to the environment variables through the SessionObject.GetEnv() so you can get to the environment through that. (CurSession.GetEnv())
OpenROAD has two other system variables which you use at your discretion II_W4GLAPPS_SYS and II_W4GLAPPS_DIR
II_W4GLAPPS_SYS is the system location where OpenROAD keeps all its own image files of various flavours and it typically is:
%II_SYSTEM%/ingres/w4glapps
II_W4GLAPPS_DIR is user defined – II_W4GLAPPS_SYS is typically in a restricted location under the Programfiles area appropriate for you 32/64 bit architecture. (on windows anyway).
If you define II_W4GLAPPS_DIR and place you images in there, OpenROAD will find them when asked to run them. I’ve not checked this for while so you may want to test it but it searches current location, II_W4GLAPPS_SYS, II_W4GLAPPS_DIR and the path for image files. (Not sure what order)
To actually find the location of where your running process was started from is not something I know off the top of my head.
Utilities such as ProcessExplorer can get this information from running processes – so it may be that there exists something in the API for your OS that might give a clue.
Cheers
Adrian
--
You received this message because you are subscribed to the Google Groups "OpenROAD Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openroad-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/48989dd9-cb67-4ce2-bfee-898a1551fbecn%40googlegroups.com.
Hi
For getting full path to running process, Google is your friend here;
wmic process get ProcessID,ExecutablePath
I was reminded by a need to extract the build date from an image file for a splash screen – I can open my own image file in blob and find it now that I know where it is.
Cheers
Adrian
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/000f01d88478%2453161e10%24f9425a30%24%40rationalcommerce.com.
Doh, that just gets me the w4glrun.exe location, will need to try again for the location of the image….
Wmic – my new best friend:
C:\WINDOWS\system32>wmic process where "name='w4gldev.exe'" get commandline /format:list
CommandLine="C:\Program Files\Ingres\ingresXH\ingres\bin\w4gldev.exe" "runimage" "workbnch.img" -cclassic -Tmin -Lworkbench.log ""
From: Adrian Williamson <adrian.w...@rationalcommerce.com>
Sent: 20 June 2022 08:43
To: 'openroa...@googlegroups.com' <openroa...@googlegroups.com>
Subject: RE: [openroad-users] Image Location/path on script
Hi
For getting full path to running process, Google is your friend here;
wmic process get ProcessID,ExecutablePath
I was reminded by a need to extract the build date from an image file for a splash screen – I can open my own image file in blob and find it now that I know where it is.
Cheers
Adrian
From: openroa...@googlegroups.com <openroa...@googlegroups.com> On Behalf Of Adrian Williamson
Sent: 20 June 2022 08:36
To: openroa...@googlegroups.com
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/000f01d88478%2453161e10%24f9425a30%24%40rationalcommerce.com.
Hi Rowell,
When setting the environment variable II_W4GL_TRACE_IMAGE_VERSION=TRUE the location of loaded image files (the image you run and all included image files) will be printed to the log file (and the OpenROAD Trace Window).
Included applications will always have to be placed in the directory specified by the II_W4GLAPPS_DIR
environment variable (default: %II_SYSTEM%\ingres\w4glapps).
Therefore I am not sure what kind of code you want to create – using a batch script that sets the II_W4GLAPPS_DIR environment variable should be sufficient to
define the location to use for included image files.
Kind regards,
Bodo.
Bodo
Bergmann
Engineering Architect
Actian | OpenROAD Engineering
www.actian.com
GESELLSCHAFTSANGABEN: Actian Germany GmbH | Sitz der Gesellschaft: Halenreie 42, 22359 Hamburg
| Geschäftsführung: Stephen Padgett, Marc Monahan | Handelsregister: Amtsgericht Hamburg | HRB 135991 | USt-IdNr: DE252449897
From: 'rowellmagno' via OpenROAD Users
Mailing List <openroa...@googlegroups.com>
Sent: Monday, June 20, 2022 4:39 AM
To: OpenROAD Users Mailing List <openroa...@googlegroups.com>
Subject: [openroad-users] Image Location/path on script
HI,
--
Hi Adrian,
maybe these will help, but I think Rowell is looking for an
answer using OpenROAD code:
https://docs.microsoft.com/en-us/sysinternals/downloads/handle
c:\Program Files\SysinternalsSuite>handle.exe |findstr /i ".img"
This should identify all included images if the files are currently open - not sure when that happens.
I remember using a bit of code which dumps out the OpenRoad
procexec call stack. Sometimes there would be confusion when two
applications have a component of the same name and we needed to
confirm. I don't recall seeing the image file name though.
Paul
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/002701d8847a%242d11afc0%2487350f40%24%40rationalcommerce.com.
-- Paul White<br> Shift Seven Solutions<br> <b>m: 0414681799</b><br> p: 0754482137<br> e: paul....@shift7solutions.com.au<br> w: https://www.shift7solutions.com.au<br> International: +61414681799<br>
do you have either of these?
c:\>set | find /i "APPDATA"
APPDATA=C:\Users\paul\AppData\Roaming
LOCALAPPDATA=C:\Users\paul\AppData\Local
E:\Ingres .NET Data Provider\v2.1>set | find /i "appdata"
APPDATA=C:\Users\pwhite\AppData\Roaming
LOCALAPPDATA=C:\Users\pwhite\Local Settings\Application Data
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/a0ba9701-c8d4-47df-9983-e61eefe279cbn%40googlegroups.com.
Hi Rowell,
The location of the image file does not mean that the OpenROAD process is using this directory as the current location.
You can get the current working directory from within
OpenROAD application using CurSession.WorkingDirectory
(see
https://docs.actian.com/openroad/11.2/index.html#page/LangRef/WorkingDirectory_Attribute_(SessionObject).htm).
For Loadnrun you should have a look at the client commands mentioned in:
https://docs.actian.com/openroad/11.2/index.html#page/ServerRef/Client_Commands.htm##ww413494
The APPDATA environment variable is used there, you should have this environment variable in your environment.
Bodo
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/a0ba9701-c8d4-47df-9983-e61eefe279cbn%40googlegroups.com.
Hi,
I would give that trace variable a go that Bodo mentioned, sounds like it will tell you where the images are ending up with load’n’run.
II_W4GL_TRACE_IMAGE_VERSION=TRUE the location of loaded image files (the image you run and all included image files) will be printed to the log file
What additional files are you talking about?
DLLs or config data in text files etc?
Cheers
Adrian
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/SJ0PR06MB78055295BA330176C1716B2593B09%40SJ0PR06MB7805.namprd06.prod.outlook.com.