0

I have an application developed in Delphi 5 that works very well in Windows 7 using the XP Mode, except for one code:

TQRCompositeReport.Prepare

That function only works if I am using an administrator account. If I am using an account that don't have administrator privileges, it works only if the "XP Mode" is disabled. Since I have some errors runing my app in Windows 7 without XP Mode, I have to activate this option. Then, I can't preview or print any reports using this command to prepare it.

I have the idea that it may concerns to some temporary files that quick report generates, once it does work using administrator accounts. However, the default temporary folder in Windows 7 is "C:\users\username\App Data\Local\Temp\ and the user has privilege to create and modify files in this folder.

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Marcela Rocha
  • 79
  • 2
  • 12
  • Why don't you try and deal with your UAC errors and make it work without XP mode? And I don't understand your Q. You say it needs XP mode to work. Then you say it only works with XP mode disabled. What are we to make of that? – David Heffernan Dec 23 '11 at 08:57
  • My application needs XP mode to work. The only command that doesn't work in XP Mode is the command above. It's not possible to make the application developed in Delphi 5 works perfectly in Windows 7 without XP Mode, because there is many changes in Windows APi since the Delphi 5 VCL. – Marcela Rocha Dec 23 '11 at 09:28
  • 3
    I've made plenty of D6 apps work with Windows 7. It's perfectly possible to do this. XP mode is for when you don't have source and can't adapt to UAC. – David Heffernan Dec 23 '11 at 09:32
  • Ok, but its not the case. I just want to find the solution to get quickreport working fine. It seems to be a users-permission problem. – Marcela Rocha Dec 23 '11 at 09:54
  • 1
    Well, sure it's a user permission problem, UAC is all about rights and permissions. If I were you I would just fix the app to work with UAC and avoid xp mode but you are obviously free to solve it however you please. – David Heffernan Dec 23 '11 at 10:01
  • 1
    You should avoid working in XP mode. you need to embed a UAC manifest (`level="asInvoker"`), or else you are working in visualized mode which will soon be deprecated. – kobik Dec 23 '11 at 14:29
  • 2
    QR might also be writing to local machine registry. use file/registry monitor (SysInternals) to identify if your application is writing to a location where it has no permissions. set the appropriate permissions with your Setup program. you application SHOULD run with standard users permissions. any other workaround will blow you in the face later (had a typo in my previous comment: `virtualized mode`)... – kobik Dec 23 '11 at 14:40
  • At the very *least*, we need to start with the error you're seeing. Next is to right-click "Run application as Administrator" and see if the problem still happens. If the problem still happens as administrator, then we know it's not a security issue. The third thing is to see if it's a Windows 7 compatibility issue by running the application on Windows XP (as a standard user, because nobody should be running as an administrator). – Ian Boyd Dec 24 '11 at 04:17
  • @kobik: QR doesn't write to the registry. It also doesn't read from it; it uses Delphi's `TPrinter` to get the list of installed printers, and the WinAPI `GetPrinter/SetPrinter` and `GetDeviceCaps` functions to configure them. – Ken White Sep 27 '12 at 21:48

0 Answers0