ServiceApplication Windows Weird Pathing Issue

I am working on creating a windows service and i’m coming across something really weird.

I have the following:

Var MainDBFolder As FolderItem

MainDBFolder = SpecialFolder.ApplicationData.Child("MySvc")

System.Log(System.LogLevelInformation, MainDBFolder.NativePath.ToText)

Now without posting everything, this comes back with the following folder:
C:\Windows\System32\config\systemprofile\AppData\Roaming\MySvc\

No problem so far. Now, in there i create a sqlite db so i can store some data, and everything seems to be working with no issues.

If i open a command prompt (as administrator) and change directory to that folder, it doesn’t exist. Everything exists up to Roaming, but the MySvc folder is missing. So i decided to run a couple of tests.

When the application opens, I run a sql query against the database that is using the folderitem to open. I get the correct number of rows back. So it’s finding the db, but i can’t get to that folder and database file from anywhere. Windows explorer, command prompt, powershell, even as administrator.

This is also running as a service from the services.msc console… So this is not being debugged directly within xojo.

It’s just the weirdest thing. I even do a command to search the entire hard drive for my main.db file, and it comes up as not found… but again, from my xojo service application running as a service, the event viewer shows the log where 2 rows are returned which is all i have written into the database so far.

I’m coming across this because i’m wanting to verify things being written to my database so i’m wanting to open my sqlite db inside of sqlitemanager app.

Any thoughts?

I apologize… So I overlooked something.

Xojo reports the path as:
C:\Windows\System32\config\systemprofile\AppData\Roaming\MySvc\

I actually found the file in the path:
C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\MySvc\

So I wonder why Xojo is not reporting it correctly.

Looks like that is the case because the app was compiled as a 32bit app. Once I compiled the app as a 64bit app for windows and updated the services, it worked as intended.

So 32bit apps go into the SysWOW64 folder…
The 64Bit apps go into the System32 folder…

Microsoft naming there is so weird… 32bit apps in a 64 named folder and 64bit apps in a folder with 32 in the name… lol…

I often get caught here too. I drag my 64-bit Web app to the Program files folder and launch it in a Command Window, wherein it creates it’s own Windows Service and starts the Service. I then quit the Command window.

When the Web app runs in Command Window, it stores it’s SpecialFolder.ApplicationData in an entirely different location than when this same Web app runs as a Service!