Install fails in unattended mode only
This is an odd one and it has me stumped.
I created my own MSI that installs one .exe under Program Files and configures some Win7 service startup values via HKLM\SYSTEM\CurrentControlSet\services\[ServiceName]\Start. The component that the registry keys are in is set to leave the keys on uninstall so it doesn't break the services. It works exactly as planned, until I run the MSI with any silent switch (i.e /qr, /qb, /qn).
When install with a silent switch, I get
Error 1406. Could not write value Start to key \SYSTEM\CurrentControlSet\Services\[ServiceName]. Verify that you have sufficient access to that key, or contact your support personnel.
I can select Ignore for the error and I find that the error only occurs on SOME of the registry keys I'm writing. If I use the exact same shortcut to launch the install, but remove the /q_ and do an attended install keeping all defaults, the install completes successfully without error.
Any ideas?
I created my own MSI that installs one .exe under Program Files and configures some Win7 service startup values via HKLM\SYSTEM\CurrentControlSet\services\[ServiceName]\Start. The component that the registry keys are in is set to leave the keys on uninstall so it doesn't break the services. It works exactly as planned, until I run the MSI with any silent switch (i.e /qr, /qb, /qn).
When install with a silent switch, I get
Error 1406. Could not write value Start to key \SYSTEM\CurrentControlSet\Services\[ServiceName]. Verify that you have sufficient access to that key, or contact your support personnel.
I can select Ignore for the error and I find that the error only occurs on SOME of the registry keys I'm writing. If I use the exact same shortcut to launch the install, but remove the /q_ and do an attended install keeping all defaults, the install completes successfully without error.
Any ideas?
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
Rheuvel
14 years ago
Posted by:
VikingLoki
14 years ago
I'm editing a few service's reg keys to set their startup type to either Manual/Automatic/Disabled. I'm already using the ServiceControl table to stop the services I'm disabling and to insure services I'm enabling are started.
AFAIK, the ServiceControl table won't adjust an existing service's startup type. It can set it for a new service it installs, but not a pre-existing service. That's why I'm plugging in the Start reg key, set to remain persistant upon uninstall. (Unless I'm wrong on that...)
AFAIK, the ServiceControl table won't adjust an existing service's startup type. It can set it for a new service it installs, but not a pre-existing service. That's why I'm plugging in the Start reg key, set to remain persistant upon uninstall. (Unless I'm wrong on that...)
Posted by:
Rheuvel
14 years ago
OK, I don't use that table too often myself. MSDN however says:
So if you know the name of the service you can actually control it even if you're not installing the service. That's what I make of it. If I remember correctly though, tools like Wise don't show any available services unless they are listed in the ServiceInstall and it has to be done manually in the table.
However, that's not what this topic is about....
Another question: Are you stopping the service in question before trying to change the key? It might cause a possible access problem when the service is currently running. So however you do it, by ServiceControl or CA's... The service has to be stopped before the MSI writes to the registry and start the service again after.
Name
This column is the string naming the service. This column can be used to control a service that is not installed.
So if you know the name of the service you can actually control it even if you're not installing the service. That's what I make of it. If I remember correctly though, tools like Wise don't show any available services unless they are listed in the ServiceInstall and it has to be done manually in the table.
However, that's not what this topic is about....
Another question: Are you stopping the service in question before trying to change the key? It might cause a possible access problem when the service is currently running. So however you do it, by ServiceControl or CA's... The service has to be stopped before the MSI writes to the registry and start the service again after.
Posted by:
VikingLoki
14 years ago
That's the strange thing. The first service getting the error is set to manual and not running. Other service startup types were updated before the error occurred. It also works fine on an interactive install, only fails on unattended. It must have something to do with the context that an interactive install runs in vs an unattended install. But why some services can be updated (both running and stopped) and some cannot (which aren't running) is not making sense to me.
Posted by:
anonymous_9363
14 years ago
Posted by:
anonymous_9363
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.