Transfer VB6 data folder from program files

I support the VB6 application, which stores its data (access files) in the subfolder of the application folder. Thus, when the user installs the application in the default location C:\Program Files\MyApp, the data goes to the virtual store. I have now been given the sweet task of converting 1000 App.Path applications or their path to a data folder in which there will be no security problems. Can someone please help me by indicating the path to some resources that will falsely load me, how to process data in a folder Users\< Username>\AppData\Local\?
Should I use the local AppData folder or can I choose a suitable location?

+3
source share
3 answers

Useful discussion can be found here.

0
source

Well, if we allow a couple of things:

  • This is only a problem for Vista or later.
  • Your data is located in subfolders under the App.Path section.

... I have a workaround that you can use.

Please note that I use this trick only when I have a bunch of old VB6 programs that were written to use data in folders under App.Path, it seems to be a quick and dirty hack to quickly launch many programs. I almost always add or update an application manifest, mainly to prevent virtualization.


The changes I make are as follows:

  • Add a little code to Sub Main (paste in Sub Main if the program does not already have one).
  • ( Sub Main) .

Vista . , , .

hunky-dory, , Win2K, XP ..


, , App.Path, PathLinks.

Pathlinks Public, . App.Path . , App.Path.

Windows Vista PathLinks App.Path( App.Path), ( ).

, - App.Path .


, . TaskDialog MsgBox.

, PathLinks - Tame App.Path Under Vista +

, , " ". Sub Sub Sub Main .

+2

AppData:

Dim sAppData As String

sAppData = Environ("USERPROFILE") & "\AppData"
+1
source

Source: https://habr.com/ru/post/1781149/


All Articles