Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Installing a Service and setting ImagePath


4 replies to this topic

MikeBergman

MikeBergman
  • Members
  • 27 posts

Posted 28 December 2003 - 01:30

I am using InstallShield Developer 7.02. I am building a Basic MSI project. We are installing our NT Service in the INSTALLDIR directory. If the installation uses the default value for INSTALLDIR (i.e.: C:\Program Files\LumenVox\SRE) the value for HKLM\SYSTEM\CurrentControlSet\Services\<ServiceName>\ImagePath is quoted; if the INSTALLDIR path is changed the value is not quoted. This is a problem if there are spaces in the path expressed in the ImagePath string value. The path is changed by way of the DestinationFolder dialog. Has anyone else seen this problem? Is there a fix or work-around?

TIA

Michael Bergman
LumenVox LLC

MikeBergman

MikeBergman
  • Members
  • 27 posts

Posted 15 January 2004 - 01:11

Has no one seen this problem????
Michael Bergman
LumenVox LLC

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 January 2004 - 08:29

Do you use the ServiceInstall table (resp. the NT Services section in the InstallShield IDE) to create the service? How do you change the value of INSTALLDIR? What you describe sounds like it might be a bug in the MSI engine.

catrill

catrill
  • Full Members
  • 16 posts

Posted 15 January 2004 - 13:46

I don't have the same problem. I am using InstallShield 7.0 with service pack 4 on Windows 2000 (perhaps you are using a different OS), and Windows Installer version 2.0. For me the ImagePath in the registry is type REG_EXPAND_SZ and is never surrounded by quotes.

My default installation directory is [ProgramFilesFolder]MsiTester.

I have tried changing the install directory with the DestinationFolder dialog to c:\Msi Tester and all was fine.

I suppose you are using the Install NT Services section in InstallShield to install the service?

Alice

MikeBergman

MikeBergman
  • Members
  • 27 posts

Posted 17 March 2004 - 00:33

Thanks Stefan and catrill for your responses. Part of my problem was how inconsistantly this problem came up, so it was hard to figure out how to solve it.

I was finally able to attend one of the MSI chat sessions and ask this question. I am providing the response here for guidance on how to solve the problem:

/******************* begin quote *********************/
Carolyn_MSFT : Q: Q: We are installing a service in the INSTALLDIR directory. If INSTALLDIR is changed
using the DestinationFolder dialog then the service will not run with an error that it is not a valid
Win32 application.

Carolyn_MSFT : A: There is a known issue relating to Windows Installer installation of services where
the binary path of the service is not quoted if it contains a space. When installing services the
binary path of the service should be quoted if it contains a space. If that doesn't happen, then the
service that is started starts at (considering a service in c:\Program Files\Service\serice.exe)
"c:\program.exe" followed then by "c:\program files\service\service.exe". Your customer probably has
a file called program.exe at the root of the drive. This issue is fixed in the upcoming MSI 3.0 release.
Until then you can use a custom action to alter the service binary path to include quotes or use the
Registry table directly if the WriteRegistryValues standard action is sequenced after InstallServices.
/******************* end quote *********************/
Here is how I am interpreting this:
1. Lauch a custom action (CA) immediately after InstallServices
2. The CA should check the version of MSI.DLL
3. If the major version is less than 3...
3a. Read the value from HKLM\SYSTEM\CurrentControlSet\Services\<ServiceName>\ImagePath and if it is not quoted, then quote it.
3b. Write the value back into ImagePath
4. Return from CA.

That seems pretty reasonable to me. If anybody else wants to comment on this, feel free.

again thanks .

Michael Bergman
LumenVox LLC