Note that there are some explanatory texts on larger screens.

plurals
  1. POWiX: Can't stop service despite being able to install and start it as LocalSystem
    primarykey
    data
    text
    <p>This is my <a href="https://github.com/prey/prey-node-client/blob/msi/dist/windows/main.wxs" rel="nofollow"><code>.wxs</code> file</a></p> <p>Particularly I managed to install a service as a LocalSystem user, and started it:</p> <pre><code> &lt;!-- Directory where [prey]/versions/[version] will be --&gt; &lt;Directory Id="ProgramFilesFolder"&gt; &lt;Directory Id="INSTALLLOCATION" Name="Prey"&gt; &lt;Directory Id="VersionsDir" Name="versions"&gt; &lt;Directory Id="VersionDir" Name="$(var.ProductVersion)"&gt; &lt;Directory Id="BinDir" Name="bin"&gt; &lt;Directory Id="BinWindowsDir" Name="windows"&gt; &lt;Component Id="CronServiceExe" Guid="ECC25B2A-FB2E-425A-92AD-DCF1D34204FF"&gt; &lt;File Id="file_8FF048AD40124B9F9C07126F2C14A765" Checksum="yes" KeyPath="yes" Source="source-msi\versions\0.10.0\bin\windows\cronsvc.exe" /&gt; &lt;ServiceInstall Id="CronServiceInstaller" Type="ownProcess" Vital="yes" Name="CronService" DisplayName="Cron Service" Start="auto" Account="LocalSystem" ErrorControl="normal" Interactive="no"&gt; &lt;/ServiceInstall&gt; &lt;ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="CronService" Wait="yes" /&gt; &lt;/Component&gt; &lt;Component Id="CronServiceDll" Guid="75C4129B-C28A-45A8-9F06-CB496259FE7F"&gt; &lt;File Id="file_11D016207EA34826A20A52524A3A82BC" Checksum="yes" KeyPath="yes" Source="source-msi\versions\0.10.0\bin\windows\Cronsvclib.dll" /&gt; &lt;/Component&gt; &lt;/Directory&gt; &lt;/Directory&gt; &lt;/Directory&gt; &lt;/Directory&gt; &lt;/Directory&gt; &lt;/Directory&gt; </code></pre> <p>And it runs fine. Everything is OK, except when I get to uninstall the product. Because despite being asked in an UAC dialog I get (<a href="http://cl.ly/image/1g1Y0p1i2L3c" rel="nofollow">Screenshot</a>), the installer insist that I don't have permissions to stop the service.</p> <p>Here is the <a href="http://cl.ly/image/3R1z0T1S2A3w" rel="nofollow">screenshot of the Error</a>, which says:</p> <pre><code>Service 'Cron Service' (CronService) could not be stopped. Verify that you have sufficient privileges to stop system services. </code></pre> <p>And, here is the specific logs (I'm uninstalling with <code>/L*v</code> option to get verbose logs). You can get the full file in <a href="https://gist.github.com/hermanjunge/1fd415b0776bb5543aa5" rel="nofollow">this gist</a>.</p> <p>Lines 2220 - 2226</p> <pre><code>MSI (s) (90:80) [19:11:54:953]: Note: 1: 2205 2: 3: Icon MSI (s) (90:80) [19:11:54:953]: Note: 1: 2205 2: 3: TypeLib MSI (s) (90:80) [19:11:54:953]: Note: 1: 2727 2: MSI (s) (90:80) [19:11:54:973]: RESTART MANAGER: Detected that the service CronService will be stopped due to a service control action authored in the package before the files are updated. So, we will not attempt to stop this service using Restart Manager MSI (s) (90:80) [19:11:54:973]: Note: 1: 2727 2: MSI (s) (90:80) [19:11:54:973]: Doing action: InstallInitialize MSI (s) (90:80) [19:11:54:973]: Note: 1: 2205 2: 3: ActionText Action ended 19:11:54: InstallValidate. Return value 1. </code></pre> <p>Lines 4624 - 4635</p> <pre><code>MSI (s) (90:80) [19:11:57:196]: Executing op: ActionStart(Name=StopServices,Description=Stopping services,Template=Service: [1]) MSI (s) (90:80) [19:11:57:196]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000) MSI (s) (90:80) [19:11:57:196]: Executing op: ServiceControl(,Name=CronService,Action=2,Wait=1,) MSI (s) (90:80) [19:12:27:239]: Note: 1: 2205 2: 3: Error MSI (s) (90:80) [19:12:27:239]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1921 MSI (s) (90:80) [19:16:38:940]: Note: 1: 2205 2: 3: Error MSI (s) (90:80) [19:16:38:940]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709 MSI (s) (90:80) [19:16:38:940]: Product: Prey Anti-theft -- Error 1921. Service 'Cron Service' (CronService) could not be stopped. Verify that you have sufficient privileges to stop system services. MSI (s) (90:80) [19:17:08:983]: Note: 1: 2205 2: 3: Error MSI (s) (90:80) [19:17:08:983]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1921 MSI (c) (48:84) [19:12:27:239]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg </code></pre> <p>Given all that information. I infere that somewhere I have to manage to start my <em>MSI</em> as an administrator. Or not?</p> <p>That's my problem:</p> <ol> <li><p>Is there a way to set up my .msi installer as an "admin only" one? (If that choice does exist).</p></li> <li><p>The weird thing is that all posts and google results I'm getting are about problems INSTALLING and STARTING the service, rather than STOPPING it. So I'm in a dead end.</p></li> </ol> <p>Please, all help will be very useful and appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload