I have an front end application (in PowerBuilder but that is not important) that is calling a helper application developed in Java and packaged with launch4j.
The end user of the application has the possibility to freely configure a path into the front end where some files will be generated by either the front-end or the backend.
I notice that on a Windows Vista or a Windows7 with UAC activated, if the user (that has no administrator privileges) has configured the output to C:\
, the generated files are silently virtualized into the c:\Users\user_name\AppData\Local\VirtualStore\
directory.
But when the process makes the java application create some files (via a FileOutputStream
) in the same C:\
, the java fails on an "Access denied" exception that could be coherent to the fact that the drive root is not accessible to users, but not to the fact that the other application is virtualized. Task manager confirms that one is virtualized and not the other.
I have found that other SO question that provides some clues but not an answser to my case, as both applications are 32 bit on a 32 system and no manifest are involved for both.
Is there a way to let the java behave like the PB application (that is to be virtualized - it a customer request)? Of course a better solution would be to check if the path is accessible and to notify the user if it is not.
EDIT: While looking at the java.exe binary, I noticed that it includes a manifest that states (but I am not familiar with that)
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
Maybe it is the answer of the question : java is not virtualized by design? EDIT: I did understand that the manifest mechanism disables the virtualization.
EPILOGUE: thanks for your explanations and your arguments helped to change the customer request. Now it is acknowledged that handling the lack of privileges to write on some folders is better than letting windows virtualize the files somewhere in the ether :o)