Menu

#43 Win7x64 - new Reg("HKEY_CURRENT_USER\\...") hangs forever

open
nobody
None
5
2014-05-04
2012-09-27
vshkil
No

Registry could be accessed from ini4j with use of simple call:
Reg reg = new Reg("HKEY_CURRENT_USER\\...");

The issue is that under the cover:
----------------------------------------------------
exec(new String[] { "cmd", "/c", "reg", "export", registryKey, file.getAbsolutePath() });
---
file = (File ret = File.createTempFile(TMP_PREFIX, DEFAULT_SUFFIX); )
---
void exec(String[] args) throws IOException
{
Process proc = Runtime.getRuntime().exec(args);//

In case of using Windows7x64 instead of WinXP host -
reg export created tmp file, but was unable to:
a) Write values from registry
b) Close cmd and return code to Java

As a result:
--- file in C:\Users\XXXXX\AppData\Local\Temp\reg-968107174841454945.reg was empty
--- process reg.exe was running
---- int status = proc.waitFor() hangs forever

It would be nice to add Timer for that call just to prevent waiting undefined amount of time.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB