1

We have stand alone C# desktop application that also uses VB6 code for some logic to write in .md5 file.

Due to windows file and registry virtualization some registry key on some machine do not get values as system redirect the registry reading to some other location in registry. To solve this problem we disabled the virtualization for our application.

That problem has been solved but now we face a new problem related to VB6 code and it is weird. When I run the application through my code base using visual studio(VS15) it works fine event when I run the exe directly from my local code base it works fine but when i run the application through start menu(after install the application) it does not work and give exception that is given below. If I run the application as Administrator it works fine.

The exception i got is from VB6 code:

tvsFilename = tvsReleaseFolder & "\Packages\" & tvsPackageName & ".md5" tvTextStream = tvFSOCP.OpenTextFile(tvsFilename, Scripting.IOMode.ForAppending, False, Scripting.Tristate.TristateFalse)

Exception from HRESULT: 0x800A0035 (CTL_E_FILENOTFOUND).

I checked the access permission to the location and all the permissions are given to the user.

And if it needs administrator permission the why is is working fine with the code base as i run the exe normally from the code base or Visual studio that is not runnig as administrator. It only happens when I installed application and run normally.

I checked to enable the virtualization again and installed the updated application now it works.

But we have to disable the virtualization for our application to get the right registry location.

I checked to create the dummy text file from the VB6 code with CreateTextFile() function and found that the problem is there in the VB6 code as it works fine with code base but does not work with installed version of application if i disable the virtualization for my application.

I searched many topics but did not find any issue related. Any help would give me the direction to move further.

Pranav Patel
  • 1,541
  • 14
  • 28
Akash
  • 81
  • 5
  • After disabling file and registry virtualization my C# application does not work properly post installation. – Akash Jan 17 '17 at 13:05
  • Are you sure you have to disable virtualization? There are escape routes which are more nuanced (e.g. the `Wow6432Node` in the registry, `sysnative` on the file system, etc) which you should look to use if you've got control over the code. – Damien_The_Unbeliever Jan 17 '17 at 14:44
  • Yes if I can not find the solution through disabling the virtualization then I have to revert the changes and try to find some other way as I can not introduce other defect by disabling the virtualization. But I just wanted to know why it is working fine with my code base and not the installed application Or work with when I run the application as Admin. I have the control over the code – Akash Jan 17 '17 at 15:35
  • What is the full path you are trying to access? I suspect you are trying to access a file in a protected area. – tcarvin Jan 18 '17 at 13:45
  • Sorry for the late reply. I found the issue and fixed it. Actually the issue was not with the tvFSOCP.OpenTextFile funtion or ".md5" file creation. The issue was totally different, we are using a exe to generate the the .PSI file and that exe is generating the file at the current working directory or normally the main program exe path. Now as I disabled the virtualization for my application OS ignores the call to generate the .PSI file when I run the application after installation as in that scenario the working directory is set into the Program folder. – Akash Feb 10 '17 at 09:34

0 Answers0