[SERVER-3976] Creating the service on Windows gets the path wrong if you don't use a drive letter Created: 29/Sep/11  Updated: 16/May/12  Resolved: 08/Feb/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.8.3
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Ian Mercer Assignee: Tad Marshall
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 64-bit


Issue Links:
Duplicate
duplicates SERVER-3097 mongod --install uses wrong image pat... Closed
Operating System: Windows
Participants:

 Description   

This works:-

"c:\mongodb\bin\mongod.exe" --config "c:\mongodb\bin\master.conf" --serviceName MongoMaster3 --serviceDisplayName MongoMaster3 --serviceDescription "Mongo Instance 1 - Master" --reinstall

But this installs the service with a nonsense path:-

"\mongodb\bin\mongod.exe" --config "c:\mongodb\bin\master.conf" --serviceName MongoMaster3 --serviceDisplayName MongoMaster3 --serviceDescription "Mongo Instance 1 - Master" --reinstall

i.e. if you don't put the drive letter there it calculates the path incorrectly when it installs the Windows Service. Windows Services shows:-

"C:\MongoDB\bin\\mongodb\bin\mongod.exe" --config c:\mongodb\bin\master.conf --service
^



 Comments   
Comment by Tad Marshall [ 08/Feb/12 ]

Same issue as SERVER-3097, fixed by using GetModuleFileName() to get the complete path to the running mongod.exe.

Generated at Thu Feb 08 03:04:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.