We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

DominusDRR
Posts: 1
Joined: Tue Apr 28, 2020 10:20 pm

How to create an exe with administrator properties?

Hi.

I'm creating a project from Visual Studio (c # and WPF).

The installer is created correctly, but when my application is started it needs to create and save a text file and an error appears (access denied to path).

After trying to investigate why it was happening, I discovered that if the executable file was run as administrator, the problem would be solved.

I have tried enabling for the * .exe file as indicated in the attached images.

Image

Image


But the problem is not solved. The user must run as administrator or manually modify the * .exe properties to change it to adminstrador.

Any suggestion or comment is welcome.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: How to create an exe with administrator properties?

Hello Dominus and welcome to Advanced Installer forums,

In order to achieve this, you can try to follow the "Always run EXE as administrator / in compatibility mode" how-to in which I have explained how you can always run an executable as an administrator.

Another solution, I believe, would be to have your executable create the text file in another location that does not require administrative privileges (e.g. %appdata%).

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”