Norma Posy
asked on
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.t xt
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\Wi ndows\Curr entVersion \Installer \Folders
User: All users
Problem: Missing MUI Reference
Data: C:\Program Files (x86)\SDPL\PoolSandS.exe
Registry Key: HKCU\Software\Classes\Loca l Settings\Software\Microsof t\Windows\ Shell\MuiC ache
User: Norma
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.t
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\Wi
User: All users
Problem: Missing MUI Reference
Data: C:\Program Files (x86)\SDPL\PoolSandS.exe
Registry Key: HKCU\Software\Classes\Loca
User: Norma
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.
UAC Virtualization. Introduced in Windows Vista.
Microsoft Blogs - I saved some files into the Program Files directory, and now they’re gone!
Microsoft Blogs - I saved some files into the Program Files directory, and now they’re gone!
ASKER
Interesting reading that blog.
Should I elect to have setup install this application somewhere else other than \Program Files (x86)?
If so, any suggestions?
Should I elect to have setup install this application somewhere else other than \Program Files (x86)?
If so, any suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
Thank you very much. -- Norma