1

I use netbeans to build native my Java application as native (.exe). I've created a new project and when I install and try to execute the application requires admin privilege. I've tried to create a new project but the problem always happen. This problem always happen with this code, I've build other aplication and the problem doesn't happen.

I got this error: "Error 740: The requested operation requires elevation"

Ps: I'm using InnoSetup from Netabeans to generate the installer.

What could be the cause of problem? Which may I verify?

Thx :)

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • It does not look like this has anything to do with [tag:inno-setup], so I'm removing that tag. The problem from Inno Setup perspective is covered by [Application does not work when installed with Inno Setup](https://stackoverflow.com/q/44333839/850848) - But you are obviously aware that the problem lies in the application itself. – Martin Prikryl Sep 01 '18 at 08:27
  • Well, what is your program trying to do? Are you trying to bind to any ports <= 1024? Is it trying to access / run any system files? If so, maybe [use this](https://stackoverflow.com/a/10558351/1790644) to invoke UAC, and spawn only the subprocess as admin, vs the whole application. – Matt Clark Sep 01 '18 at 08:29
  • More information is needed. The original source of that "740" error is not Java, NetBeans or Inno Setup - it's Windows. So update your post with [1] Your Windows version. [2] Full details of how and where that error was reported. Just stating _"I got this error"_ is not enough. [3] Any relevant errors in the Windows Event logs. – skomisa Sep 02 '18 at 06:21

1 Answers1

0

Thanks guys for your help!

But I've solved the problem. The name of the project was 'UpdaterSuperAudio' and for some unknown reason it requires admin level, after I change the name to 'AtaulizarSuperAudio' ('Atualizar' means 'Updater' in pt-BR) the problem disappear.

It has no relation with my code, was just the name!

  • 2
    Windows heuristically "detects" if an .exe is an installer and makes it run elevated. Part of that decision process is checking .exe name for keywords like "Setup". See also https://stackoverflow.com/q/35824858/850848#35824986 – Martin Prikryl Sep 03 '18 at 06:26