Starting a service from the MSI installer, which depends on the assemblies installed in msi

I use WiX to write the MSI installer to start the service, which depends on the DLLs installed by MSI. In Vista, DLLs are added to the general assembly cache in the MSI phase InstallFinalize, so I cannot use the built-in start service command in WiX. This one tries to start the service before the DLLs are in the GAC, and will fail. Apparently, the solution is to use a custom action instead of [1] and start after InstallFinalize.

The custom action that I used began with sc. Everything works fine when running the installer as an administrator, but working as a regular user does not work. The installer will increase the privileges for the actual installation phase, but will drop them after the installation is completed, and the service will start using sc, since the non-privileged user will fail. Setting custom actions for postponement and without issuing for obtaining administrator rights will not work after InstallFinalize[2].

As the last kludge, I tried adding <Condition>Privileged</Condition>to the WiX file to tell the user that the installer should run as Administrator, but I could not get this to work. The value is Privilegedset during installation to 1, possibly when higher privileges are granted to the main installation sequence.

So, has anyone else encountered a combination of Vista, a non-administrator, the installer must start the service, and the service needs the materials that go into the GAC during installation to start? Is there any working general approach to this?

[1] http://www.mail-archive.com/ wix-users@lists.sourceforge.net /msg09162.html

[2] http://www.mail-archive.com/ wix-users@lists.sourceforge.net /msg15381.html

+3
3

, .

+2

:

  • , GAC. (.. InstallInitialize InstallFinalize).

  • bootstrapper ( , MSI ). (, GAC) MSI, , , .

  • ( , MSI). , . , MSI , , InstallInitialize InstallFinalize. sc.

+1

@sascha. , . . IMHO, Windows w.r.t. . - .

+1

Source: https://habr.com/ru/post/1720186/


All Articles