cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ChristopheOce
Level 7

Service doesn't uninstall !!!!

Hi,

I have a basic msi project, in this project i have two service (a , b ).
Sometimes and i don't know WHY one of this service still on the machine when i uninstall the product !

The file executable (*.exe) is not present on the machine but i CAN SEE the service in the service management of windows !!!

Unhappy it's arrives sometimes and i can't reproduce it but i the service still be there on the machine when i install at one i have this error when the installer try to install the service because the service is still be on the machine !

[CODE]
MSI (s) (DC:D0) [11:49:25:625]: Executing op: ActionStart(Name=InstallServices,Description=Installing new services,Template=Service: [2])
Action 11:49:25: InstallServices. Installing new services
MSI (s) (DC:D0) [11:49:25:625]: Executing op: ProgressTotal(Total=2,Type=1,ByteEquivalent=1300000)
MSI (s) (DC:D0) [11:49:25:625]: Executing op: ServiceInstall(Name=******,DisplayName=Océ Count Logic Data Retrieve,ImagePath="C:\Program Files\***\****\*****\Service\****.exe",ServiceType=16,StartType=2,ErrorControl=1,,Dependencies=MSSQL$****[~][~],,,Password=**********,Description=Retrieves data from central accounting.)
MSI (s) (DC:D0) [11:49:25:890]: Executing op: ServiceInstall(Name=****,DisplayName=*******,ImagePath="C:\Program Files\***\***\***.exe",ServiceType=272,StartType=2,ErrorControl=1,,,,,Password=**********,Description=******)
Error 1923.Service ***** (****) could not be installed. Verify that you have sufficient privileges to install system services.
MSI (s) (DC:D0) [11:50:01:328]: Product: ****** -- Error 1923.Service ******* could not be installed. Verify that you have sufficient privileges to install system services.

[/CODE]

Someone has he got the same problem and if yes ..what is the solution ?!
It's very boring...

Thanks for your idea
Christophe
Labels (1)
0 Kudos
(8) Replies
Alpesh
Flexera Alumni

Hi,

What are the 'Control NT Services' properties you have chosen for the service you are facing problem with ?

Thanks,
Alpesh
0 Kudos
ChristopheOce
Level 7

Hi Alpesh,

Here is it the control nt properties of my service:

Install start : no
Install stop : no
Install delete : no
Uninstall start : no
uninstallstop : YES
uninstall delete : no

service argument : /s
wait type : wait for the scm

Install start is put to NO because i start the service at the end of installation with a custom action (install script).

I think the windows installer can't stop the service when i remove my product and after a certain time it crash !
i think he can delete the file executable but can't remove entry in the management service !!!!

I think PERHPAS put the option install delete to YES as this is an entry is PRESENT on the target machine perhpas the windows installer will delete this entry and my installation will be success 🙂 !

Or haven you some idea for to resolve this problem or what i can check !?

Thanks for all
Christophe
0 Kudos
Alpesh
Flexera Alumni

Hi Christopher,

Since you have the service already existing on the machine, I will advise you to create another msi project for this service, which has the 'Install Delete' option set to YES. Once you run this installer, your service will be removed from the machine.

Now go back to your original msi project and set the 'Uninstall Delete' option to YES. So now everytime you unistall, your service will be stopped and removed from the machine.

Let me know if this resolves your problem.

Thanks,
Alpesh
0 Kudos
ChristopheOce
Level 7

Hi Alpesh,

I've remark before to resolve the problem if the service is present at after the uninstallation IF I REBOOT the computer the service IS NOT PRESENT !!!!!

So, for resolved this problem i have add on my project a reboot just at uninstallation with a script :


function RebootAtUnInstallation(hMSI)

NUMBER cchValueBuf, nRetCode;
STRING valeurReboot, szReboot;
begin

//Set the property to REBOOT
valeurReboot = "Force";
MsiSetProperty(hMSI, "REBOOT", valeurReboot);
end;


This custom action is place next to installFinalize with condition REMOVE="ALL"
Now, i've just some test and that's work ..

But as you said on your last post, i put uninstall delete to YES in my package !

I'm a beginner with IS 2008 but with pratice everyday i begin to know IS 2008 🙂

Thanks for your time
Christophe
0 Kudos
chbiki
Level 6

Hi,
Can someone summarize here the steps to follow to install services within a Basic MSI-Project. It is necessary to write an InstallScript in order to install services ?. In our project the services are used to start a product driver.
From an old install project here is the code writen in Wise-Script that will be converted in Basic Msi-project:
item: Execute Program
Pathname=%SYS32%\servicename.exe
Command Line=/Service
Default Directory=%SYS32%
Flags=00001010
end
item: Execute Program
Pathname=%SYS32%\ma.exe
Command Line=config servicename start= auto
Default Directory=%SYS32%
Flags=00001000
end
item: Execute Program
Pathname=%SYS32%\ma.exe
Command Line=start servicename
Default Directory=%SYS32%
Flags=00001000
end

Thanks in advance!
chbiki
0 Kudos
Mark_Koehler
Level 6

I believe this is actually a limitation of the OS not InstallShield. Under certain versions of Windows, deleting a service will only take place after a reboot.
0 Kudos
tomerdr
Level 6

Note that this is a generic message.

Make sure the service was stopped,i had the same problem and found that i didnot shut down all threads inside the service.
0 Kudos
Not applicable

Generally speaking, services will fail to be removed until a reboot as a result of open handles, which is what tomerdr said. The essence is that the service enters the SERVICE_STOP_PENDING state and is waiting for all threads to close ( usually ). My understanding is that this would normally be a state in which the service code would manually enter prior to cleaning up existing resources.

This likely indicates that you have a remaining handle open to this particular service and may want to validate that no other processes are running and that the service state is acting appropriately ( no extra refcounts ).

More information on this can be found here:
http://msdn.microsoft.com/en-us/library/ms686241(VS.85).aspx
0 Kudos