Program opens wrong file.

I used Inno to build a setup.exe for a VB6 program to be installed on a Win7 machine. Application has 4 exe's and a collection of auxilliary txt files, and one OCX.

Inno.iss script flags: "ignoreversion" on all except for MSFLEXGRID.OCX which is flagged "restartreplace sharedfile regserver".

The setup.exe generated by Inno was used to install this application on the C drive of a Win7 machine.

Development files are on an external "E" hard drive. There are several versions of the aux files there. The correct ones (listed in the Inno script) successively installed on C drive. I know because I looked at them.

Here is the VB6 code to access one of those aux files:

sFileName = "DataBars.txt"
sFilePath = App.Path & "\" & sFileName
MsgBox sFilePath, vbOKOnly
Open sFilePath For Input As #1

I put that MsgBox there (temporarily) so I could actually see the path:
C:\Program Files (x86)\PoolSandS\DataBars.txt

Now here comes the mystery: When I run this installed app, it opens one of the other DataBars files on the E drive!

If I unplug the USB from the E drive, the program bombs because it cannot find the file it is looking for.

What is going on here? Why is it not opening the file specified in sFilePath? Please help.

I had built this setup.exe with "Advanced", but that was a limited one-time download. It seemed to work fine, but I don't want to spend $300 for it.

If it helps: I took a look at the registry with CCleaner. Got two reports:

Problem: Installer Reference Issue
Data: C:\Program Files (x86)\SDPL\PoolSandS
Registry Key: HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\Folders
User: All users

Problem: Missing MUI Reference
Data: C:\Program Files (x86)\SDPL\PoolSandS.exe
Registry Key: HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache
User: Norma
NormaPosyPhysicistAsked:
Who is Participating?
 
Chris WatsonConnect With a Mentor Software DeveloperCommented:
You could install the application in the Program Files (x86) folder, but save the data files which you need to read/write in the user's AppData folder.

Another option would be to install the entire application in the user's AppData folder. I think Google Chrome employs this strategy to install on low-privilege accounts.
0
 
Chris WatsonSoftware DeveloperCommented:
Could it be something do with transparent file redirection (I forget the actual name for it)? There's a feature of recent versions of Windows where, for compatibility reasons with old applications, if you try to access a file in a protected location, you actually access a file in a different (non-protected, user specific) location.
0
 
Chris WatsonSoftware DeveloperCommented:
0
 
NormaPosyPhysicistAuthor Commented:
Interesting reading that blog.

Should I elect to have setup install this application somewhere else other than \Program Files (x86)?

If so, any suggestions?
0
 
NormaPosyPhysicistAuthor Commented:
That worked! I created my own C:\SDPL folder. When the installer created by Inno came up, I overwrote the destination folder with this one. Program installed, and ran fine.

Thank you very much. -- Norma
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.