PDA

View Full Version : PK_CONFIG_STORE() error -803 on Windows 7 32bit



Lance.Hall
10-29-10, 03:15 PM
Windows 7 32bit, MonteCarlo 6.7.0.36, InlineMM

My application has been working fine for ages on Windows 2000, Windows 2003 & Windows XP where the internal configuration file "pikaconfig.xml" exists in "C:\Program Files\Pika\MonteCarlo\conf" by default. Now on Windows 7, my application gets the above error obviously because the default location is intentionally read-only when running as a normal user. When my application is "Run as an Administrator", the above error does not occur but this is NOT an acceptable workaround or acceptable solution to this issue.

Note that PikaSetup.exe always requests internally to "Run as an Administrator" when it starts and will therefore never get this error.

According to the PK_CONFIG_STORE() documentation, one can define the environment variable, PK_MC_CONF_DIR, to determine the location of the configuration file. I defined this as a system environment variable and none of the following values seems to have any effect on the operation of my application or PikaSetup.exe:

C:\ProgramData\Pika\MonteCarlo\conf
C:\ProgramData\Pika\MonteCarlo\conf\
C:\ProgramData\Pika\MonteCarlo\conf\pikaconfig.xml
C:\ProgramData\Pika\MonteCarlo\conf\xyzzy.xml

It seems that pikaconfig.xml is always residing in "C:\Program Files\Pika\MonteCarlo\conf" regardless of the PK_MC_CONF_DIR environment variable existence/value.

Has anyone gotten the above environment variable to work at all as documented?
Is there maybe an error in the documentation regarding this environment variable?
Has anyone solved this error issue on Windows 7 and how?

Lance.Hall
11-17-10, 01:41 PM
The following is the workaround that applies to Windows Vista, Windows 7 & Windows 2008 for this MonteCarlo installation issue:

- the environment variable, PK_MC_CONF_DIR, referenced in the API documentation for PK_CONFIG_LOAD() & PK_CONFIG_STORE() is incorrect and should be PK_CONF_DIR. See elsewhere in the Pika documentation for information about the PK_BASE_DIR and PK_CONF_DIR environment variable usage.

- after one completes the installation of the MonteCarlo software, manually change the PK_CONF_DIR environment variable created by the installation from a value of "C:/Program Files/Pika/MonteCarlo/conf" to "C:/ProgramData/Pika/MonteCarlo/conf".

- create the "C:/ProgramData/Pika/MonteCarlo/conf" directory

- move the full contents of "C:/Program Files/Pika/MonteCarlo/conf" to "C:/ProgramData/Pika/MonteCarlo/conf"

- at least "pikaconfig.xml" and maybe other files in the "C:/ProgramData/Pika/MonteCarlo/conf" directory tree will need "write" access enabled.

- Pika support has agreed that the above workaround is sensible and a future release of the MonteCarlo installation will automatically install correctly for this WinVista/Win7/Win2008 issue.