Archive: Turning Windows 7 features on and off


Turning Windows 7 features on and off
I have a project that uses the windows indexing service through Microsoft sql 2008 server. Now Microsoft decided to get rid of this service starting from vista and replaced it with windows search. The thing is that i still need the indexing service for 2 reasons. One is existing code and second is that Microsoft's driver for windows search from sql server does not work! :)

I found online that you can enable the indexing service again by going to
Start > Control Panel > Programs > Programs and Features > Turn Windows Features on or off > Indexing Service

and it works just fine. The problem is that i would like my installer to automatically enable this service. Note that this is not a matter of simply enabling a service (i know how to do that). This is a feature of windows not enabled by default and i need a way to do it automatically.

Any thoughts?


The Indexing service is called CISVC and can be found in

[HKLM]\SYSTEM\CurrentControlSet\services\CISVC

You can check if the key exists or use the service plugin to check if the service is installed and if not create it.
Alternatively you can use the sc.exe command invoked from nsExec to create the service:
nsExec::ExecToLog '"$SYSDIR\sc.exe" create CISVC binpath= "$SYSDIR\cisvc.exe" type= share DisplayName= "@$SISDIR\CISVC.EXE,-1" start= auto depend= RPCSS'


You may want to manually modify some registry entries after that (adding a description etc). Have a look at the bottom of this page to get an idea.
Note that you need elevated privileges to do all the above.
Hope this helps,
CF

As it turns out i found a way to enable windows features through the command line. For the indexing service i use this:

ExecWait 'ocsetup.exe Indexing-Service-Package /passive /quiet'