Hey, me again...
I'm writing a new routine in which I want to install a service. It seems to be working fine, however, I need that one thing to make it perfect.
As written in the title, there is a checkbox in the service properties which is called "Allows service to interact with desktop".
Is it possible to check that checkbox after creating the service?
Thanks for your answers.
Allow service to interact with desktop
20 posts
It would be better if you could redesign your service so it does not require this, in Vista and later all services run in a separate session to prevent security issues. Even if you could turn this option on, what happens when there is more than one user logged in?
I will try to redesign it, but is it possible to get that checkbox checked? Just in case I can't redesign it...
At the Windows level you pass a flag to the CreateService or ChangeServiceConfig functions. I don't know how you are installing the service so I can't really provide any more details.Originally Posted by ascTim View PostI will try to redesign it, but is it possible to get that checkbox checked? Just in case I can't redesign it...
Before you even try you should read this: https://msdn.microsoft.com/en-us/lib...02(VS.85).aspx
Alright, thank you once again, I'll read through it and keep that functions in mind 🙂
So I was trying to create the service with the SimpleSC::Install command, which I downloaded from http://nsis.sourceforge.net/NSIS_Simple_Service_Plugin
Unfortunately I can't find the servicelib.nsh to include the command.
Can anyone help me out here? Any link?
Unfortunately I can't find the servicelib.nsh to include the command.
Can anyone help me out here? Any link?
Who says every plugin needs a .nsh?Originally Posted by ascTim View PostSo I was trying to create the service with the SimpleSC::Install command, which I downloaded from http://nsis.sourceforge.net/NSIS_Simple_Service_Plugin
Unfortunately I can't find the servicelib.nsh to include the command.
Can anyone help me out here? Any link?
That's what I thought, since every plugin I used so far needed one... I've put the .dll into the /plugin directory but I run into an error when compiling: "Invalid command: SimpleSC::Install
Maybe it's because of that Source directory in the .zip file? I don't know where to copy it to.
Maybe it's because of that Source directory in the .zip file? I don't know where to copy it to.
Invalid command usually just means you did not put the .dll in the correct directory.
in the plugins directory there are two more directories, "x86-unicode" and "x86-ansi". I've put it into both of them...
If there are two directories there then you are probably using NSIS 3 beta and probably a early beta because there was a change to the invalid command message at some point.
If the plugin package only has one .dll then you should only put it in x86-ansi.
If the plugin package only has one .dll then you should only put it in x86-ansi.
I am using the 3.0a2 version.
As I said I've put the .dll into both filders so it's in the x86-ansi folder as well.
I still believe it has something to do with the Source folder that is contained in the .zip file. There are 6 other files in it:
- LSASecurityControl.pas
- NSIS.pas
- ServiceControl.pas
- SimpleSC.cfg
- SimpleSC.dof
- SimpleSC.dpr
I have no idea what to do with them... maybe you have?
As I said I've put the .dll into both filders so it's in the x86-ansi folder as well.
I still believe it has something to do with the Source folder that is contained in the .zip file. There are 6 other files in it:
- LSASecurityControl.pas
- NSIS.pas
- ServiceControl.pas
- SimpleSC.cfg
- SimpleSC.dof
- SimpleSC.dpr
I have no idea what to do with them... maybe you have?
No you don't have to do anything with the Source folder. Are you still getting errors after putting the .dll in the x86-ansi folder? You should also upgrade to the latest beta!
I've updated to 3.0b3 but it's still the same error message...
Are you sure it's the exact same message? After upgrading it should say "plugin not found" or something like that, not "invalid command".Originally Posted by ascTim View PostI've updated to 3.0b3 but it's still the same error message...
If you execute makensis -v4 yourscript.nsi (or use MakeNsisW) it should list all detected plugins in the compiler output.
When running MakeNSISW it says
Section: "SRVANY"
Invalid command: SimpleSC::Install
Error in script "Some\path\to\file\file.nsi" on line 51 -- aborting creation process Any specific line you want to see?Are you sure you don't have more than one version of NSIS installed? Do you see the list of plugins at the start of the compiler output?
Section
!warning "${NSIS_VERSION}/${NSIS_PACKEDVERSION}"
SimpleSC::Install whatever
SectionEnd in NSIS 3 gives mewarning: !warning: v3.0b3/0x03000060 (C:\...\test.nsi:751)
Plugin not found, cannot call SimpleSC::Install
Error in script "C:\...\test.nsi" on line 752 -- aborting creation process
I can see 2 problems:
1) You did not copy the .dll file into correct directory
2) You are using mismatch settings - Unicode plugin for Ansi installer or related
1) You did not copy the .dll file into correct directory
2) You are using mismatch settings - Unicode plugin for Ansi installer or related
Oh my god. Thanks Anders for your answer, I looked through the loaded plugins, which says:
So next time I get those errors I will check with MakeNSISW.exe first. It would also be great if anyone who's authorized to edit the documentation for that plugin could correct it.
Have a great week!
Processing default plugins: "C:\Program Files (x86)\NSIS\Plugins\x86-ansi\*.dll"
.
.
.
+ SimpleSC::InstallService In the documentations it's only "SimpleSC::Install", so it was only the wrong syntax. It's compiling now.So next time I get those errors I will check with MakeNSISW.exe first. It would also be great if anyone who's authorized to edit the documentation for that plugin could correct it.
Have a great week!
Most pages on the wiki can be edited by anyone, it is a wiki after all.
I changed the way NSIS 3 reports these errors so both the plugin not found and plugin function not found cases should have separate error messages in the next release...
I changed the way NSIS 3 reports these errors so both the plugin not found and plugin function not found cases should have separate error messages in the next release...