EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Windows Service Deployment and Network Drives

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#11395
Posted: 10/20/2009 00:43:42
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

I have a successful C# winforms app that adds a z: network drive and all is happy. I have converted that to a service using (essentially) the same code but my network drive doesn't appear in windows explorer.

I am using the following code:

Code
                string mountingPoint = "Z:;demo;test";

                mCbFs.AddNetworkMountingPoint(mountingPoint, false, CbFsNetworkSymLinkFlags.nsmAllowMapAsDrive);

When I use a command prompt I can change to z: drive and entering DIR provides the following:

Code
Z:\>dir
Volume in drive Z is i3 Virtual Disk
Volume Serial Number is 1234-5678

Directory of Z:\

20/10/2009  04:42 PM    <DIR>          ;demo;test
               0 File(s)              0 bytes
               1 Dir(s)      99,999,744 bytes free

Z:\>


I have installed the network redirector dll via helper dll with no errors, and have stepped through the entire code. In my winforms app, as soon as I execute the AddNetworkMountingPoint, my drive appears in Explorer. For the service, the drive never appears.

Anyone got any ideas what is wrong? C#, 32-bit, Windows Server 2003.
#11396
Posted: 10/20/2009 01:26:10
by Eugene Mayevski (EldoS Corp.)

There are two helper DLLs, you need to install another one, not network redirector dll (actually, you need both, but it's another one that addresses the above question).


Sincerely yours
Eugene Mayevski
#11407
Posted: 10/20/2009 20:55:07
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

I've added the Mount helper dll as well, but for some reason it continually returns TRUE for the Reboot flag. After rebooting, it still returns the same issue.

I checked and made sure I was pointing to the 32-bit version when trying to install the helper dll and it looks OK:

Code
                bool Reboot = false;

                // Install mount notifier
                CallbackFileSystem.InstallHelperDll(@"C:\Program Files\EldoS\Callback File System\HelperDLLs\VSMntNtf\32bit\VSMntNtf.dll", productGuid, ref Reboot);
                if (Reboot)
                {
                    LogWarning("Mount notifier helper dll installed - reboot required");
                }


Very strange! Anything else I can check? The Windows Forms version still works fine on the same machine, but the service just doesn't want to play.
#11408
Posted: 10/20/2009 22:45:34
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

I just tested the same thing with my "working" WinForms app, and I get the Reboot variable coming back as "true" each time when I call the InstallHelpDll (as above). I've also tried rebooting several times but no luck there either.
#11409
Posted: 10/20/2009 23:27:23
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

Another item to add - I swapped AddNetworkMountingPoint to AddMountingPointEx and it worked fine... very confused now! Service loads correctly and attaches my local drive, just doesn't seem to want to mount the network version. I'm using my own account as the service account (full admin permissions) to try and test this, so in theory security should be the same?
#11410
Posted: 10/21/2009 04:10:17
by Volodymyr Zinin (EldoS Corp.)

You don't need to call the helper dll install method again after reboot. If the method returns success then the dll has been installed correctly. Just reboot the machine if the RebootNeeded flag is set.
BTW a good idea is to install the driver and helper DLLs only once during a program (that uses these components) installation.


Quote
Gavin McKay wrote:
Another item to add - I swapped AddNetworkMountingPoint to AddMountingPointEx and it worked fine... very confused now! Service loads correctly ....

Please reboot the machine after the successful VSMntNtf.dll installation and call AddNetworkMountingPoint with the parameter BOOL LocalLink set to FALSE. Will the mounting point be created? If not then try to access the storage
via this mounting point name from the command line. Will it be accessible?
Thanks.
#11416
Posted: 10/21/2009 19:17:31
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

Quote
Vladimir Zinin wrote:
You don't need to call the helper dll install method again after reboot. If the method returns success then the dll has been installed correctly. Just reboot the machine if the RebootNeeded flag is set.
BTW a good idea is to install the driver and helper DLLs only once during a program (that uses these components) installation.


OK, I've removed that logic from my service, it now doesn't try to test if they are installed and then install. However, the Reboot flag was continuously being set to TRUE with my call to:

Code
                CallbackFileSystem.InstallHelperDll(@"C:\Program Files\EldoS\Callback File System\HelperDLLs\VSMntNtf\32bit\VSMntNtf.dll", productGuid, ref Reboot);


Even though it appeared it was installed correctly.

Quote

Please reboot the machine after the successful VSMntNtf.dll installation and call AddNetworkMountingPoint with the parameter BOOL LocalLink set to FALSE. Will the mounting point be created? If not then try to access the storage
via this mounting point name from the command line. Will it be accessible?
Thanks.


The mounting point is created, but it includes an empty folder that matches my network mounting point address. For example I am using:

Code
                
string mountingPoint = "Z:;demo;test";

                mCbFs.AddNetworkMountingPoint(mountingPoint, false, CbFsNetworkSymLinkFlags.nsmAllowMapAsDrive);


I can successfully connect to my "Z:" network drive, which appears as "test on 'demo' (Z:)" in Windows Explorer. But listed in this network drive is a folder called ";demo;test". Changing to the command prompt to access gives me:


Code
Z:\>dir
Volume in drive Z is i3 Virtual Disk
Volume Serial Number is 1234-5678

Directory of Z:\

22/10/2009  11:18 AM    <DIR>          ;demo;test
22/10/2009  10:59 AM    <DIR>          TestFolder
21/10/2009  03:43 PM                14 New Text Document (2).txt
21/10/2009  03:44 PM                10 New Text Document (3).txt
               2 File(s)             24 bytes
               2 Dir(s)      99,999,744 bytes free

Z:\>


and changing folders in ";demo;test" gives:

Code
Z:\;demo;test>dir
Volume in drive Z is i3 Virtual Disk
Volume Serial Number is 1234-5678

Directory of Z:\;mossdemo2;test

22/10/2009  11:18 AM    <DIR>          .
22/10/2009  11:18 AM    <DIR>          ..
File Not Found

Z:\;demo;test>


Hope this helps!
#11417
Posted: 10/21/2009 23:56:02
by Eugene Mayevski (EldoS Corp.)

Quote
Gavin McKay wrote:
OK, I've removed that logic from my service, it now doesn't try to test if they are installed and then install. However, the Reboot flag was continuously being set to TRUE with my call to:

Code CallbackFileSystem.InstallHelperDll(@"C:\Program Files\EldoS\Callback File System\HelperDLLs\VSMntNtf\32bit\VSMntNtf.dll", productGuid, ref Reboot);

Even though it appeared it was installed correctly.


You should NOT continuously call InstallHelperDll. It is called only once, when your application is installed. After reboot you *don't* call it.


Sincerely yours
Eugene Mayevski
#11418
Posted: 10/22/2009 01:55:37
by Volodymyr Zinin (EldoS Corp.)

Quote
Gavin McKay wrote:
I can successfully connect to my "Z:" network drive, which appears as "test on 'demo' (Z:)" in Windows Explorer. But listed in this network drive is a folder called ";demo;test".

Please specify what version of Windows and CallbackFS are you using?
#11434
Posted: 10/22/2009 22:05:10
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

- Windows Server 2003 R2 SP2
- Callback FS 32-bit version 2.5.54.139
- Visual Studio 2008 (C#)
- .net framework 3.5
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 8436 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!