2

I want to install a service from within a merge module. The service StartName and Password should be configured by user.

My installer is configured as following

module.msm

My Module has Id C68FD1DE_B6A0_4BC1_A7BB_D7DBF65F2DB7 and defines two properties SERVICE_PASSWORD and SERVICE_USER, both having default value NOT DEFINED. I added two 'Property set with Formatted' custom actions and configured these properties as targets. I also have the properties configured on service installation.

setup.exe

My setup loads the merge module and sets the properties SERVICE_PASSWORD and SERVICE_USER on module.msm.

On execution I get the error Service 'service.exe' could not be installed. Verify that you have sufficient privileges to install system services., I checked the log and found following important entries:

MSI (c) (88:DC) [10:36:57:178]: PROPERTY CHANGE: Adding SERVICE_PASSWORD property. Its value is 'password'.

MSI (c) (88:DC) [10:36:57:178]: PROPERTY CHANGE: Adding SERVICE_USER property. Its value is '.\user'.

MSI (s) (70:04) [10:38:18:771]: Doing action: ServicePassword.C68FD1DE_B6A0_4BC1_A7BB_D7DBF65F2DB7

MSI (s) (70:04) [10:38:18:781]: PROPERTY CHANGE: Adding [SERVICE_PASSWORD] property. Its value is 'password'.

MSI (s) (70:04) [10:38:18:781]: Doing action: ServiceUser.C68FD1DE_B6A0_4BC1_A7BB_D7DBF65F2DB7

MSI (s) (70:04) [10:38:18:791]: PROPERTY CHANGE: Adding [SERVICE_USER] property. Its value is 'user'.

MSI (s) (70:04) [10:38:29:391]: Executing op: ServiceInstall(Name=service,DisplayName=service,ImagePath="C:\Program Files\company\product\service.exe",ServiceType=16,StartType=2,ErrorControl=1,,Dependencies=,,StartName=NOT DEFINED,Password=****,Description=,,)

When I have a working property then it say Modifying instead of Adding.

MSI (s) (64:9C) [12:06:03:108]: PROPERTY CHANGE: Modifying SERVERNAME.ABB6A92E_9A58_4320_981C_149C0F4EE78A property. Its current value is 'defaultserver'. Its new value: 'targetserver'.

It seems that the correct values are passed to my merge module but are not used. Other merge modules parameterized this way are working, but the properties are not used to install services. So what am I missing to get this to work?

dwonisch
  • 5,595
  • 2
  • 30
  • 43
  • This will sound dumb, but I'd make sure that the service startname really is uppercase SERVICE_USER. That "not defined" seems to saying that it's a property that hasn't been defined. – PhilDW Apr 02 '14 at 17:23
  • Does the .\user account have permission to run as a service? – Christopher Painter Apr 02 '14 at 18:24
  • BTW, you don't pass data to a merge module. A merge module is merged into your MSI at build time. After that it doesn't exist. It's just a combined set of table data. – Christopher Painter Apr 02 '14 at 18:24
  • The property names were correct and it doesn't have anything to do with permissions. The error was that the custom actions to set the properties were called on Install step and that is executed after InstallServices in Windows Installer Sequence. I will answer my question and add details as far I find some time. Thanks a lot guys. – dwonisch Apr 02 '14 at 18:27

0 Answers0