0

I have an "Advanced Installer" project that I am trying to use to install my "TopShelf" windows service that I have built.

I found the spot in Advanced Installer to grant permissions to the installation folder, but I don't see a way to grant permissions to the "Local System" account.

Manually, this is done by going to the security option in the properties of the folder and adding a user with the same name as the computer name but ending with a $. For Example MyNiceComputer$. (Oh, and you have to select the "Computers" option in the types area.)

But there is no way to do all this in Advanced Installer. If I do make one like MyNiceComputer$, it just makes an empty entry in the security tab. (No Permissions on it, even though I setup for full control.)

Has anyone ever needed to do this with Advanced Installer?

Additional Details:
I am installing an app that runs as a windows service. (It is a console app built with TopShelf).

Our company policy is to install all our applications into a folder that looks like this:

C:\OurCompanyApps\MyApp

When I create the installer, it runs fine, but then I when I start up the Windows Service, I get the following error:

Windows could not start the MyApp service on Local Computer

Error 5: Access is denied.

But when I grant access to Local System (by giving Full Control rights to myNiceComputer$ on the MyApp folder), then this error goes away and the app runs fine. From what I read, this is because the application is running as Local System.

It seems odd that it needs full control but it does not work without it. (But as far as I can see, the contents of the folder are un-altered).

@Bogdan Mitrache seems to indicate that granting permissions to Local System is not possible via Advanced Installer. This is good to know (so I don't waste more time looking). I will probably ask my System Admins for a dedicated system account to run my service as. Not ideal, but it will serve as a work around.

Community
  • 1
  • 1
Vaccano
  • 78,325
  • 149
  • 468
  • 850
  • I'm not sure that there is a way to do it through AI (one of my groups shows a SYSTEM user, but it's an MSSQL group and I haven't bothered to check the SID yet), but you could definitely write a custom action (I'd recommend C#) to handle it. Bogdan's good about answering SO, but you may also want to hit their forums as they answer regularly there too. – adamdc78 May 22 '16 at 01:37
  • Sorry, but I must be missing something. Why do you need to give it specific permissions? Isn't the LocalSystem account by default owner of privileges high enough to access machine wide resources? http://stackoverflow.com/questions/510170/the-difference-between-the-local-system-account-and-the-network-service-acco – Bogdan Mitrache May 23 '16 at 09:16
  • Also, if you want those permissions just to write in the installation folder, you should instead re-think the installer/application. First of all in the install folder you should not write stuff at application run time, for that you have AppData and UserData folders. Or if you really need to write in the installer folder, choose a default location which does not require any special permissions. – Bogdan Mitrache May 23 '16 at 09:19
  • @adamdc78 - I tried to go to the form, but when I signed up, the confirmation email never hit my inbox or spam filters, so I could not post. – Vaccano May 23 '16 at 17:17
  • @BogdanMitrache - I added the details that explains why I am needing what I am needing. It is under ***Additional Details***. – Vaccano May 23 '16 at 17:18
  • What happens when you set the service to start as an admin user? This is definitely something which can be achieved by the installer without custom actions. – adamdc78 May 23 '16 at 19:11

1 Answers1

0

So, in one of my "less finer" moments of debugging, I mixed up two different things.

There was also a file missing, (my config file). I restored that and changed the permissions at the same time. But then I forgot to go back and verify which one was the actual fix. (I know, not good debugging.)

So, the Access is denied error was due to a missing file.

Vaccano
  • 78,325
  • 149
  • 468
  • 850