Jump to content











Photo
- - - - -

Installing imdisk.sys manually using sc.exe


  • Please log in to reply
9 replies to this topic

#1 aeon_dan

aeon_dan
  • Members
  • 2 posts
  •  
    Singapore

Posted 07 December 2011 - 07:47 AM

Hi,
I want to install the driver itself (imdisk.sys) to be manually installed and run using sc.exe. I do not want to use the installer provided.
The reason is to simply check and compare my driver which basically creates virtual drives and imdisk. I can use "sc create myDriver type= filesys binpath= C:\myDriver.sys", and then use "sc start myDriver" successfully.

However when I copy just the Imdisk.sys from another clean machine (with no previous imdisk installation), and use the commands "sc create Imdisk type= filesys binpath= C:\Imdisk.sys" or "sc create Imdisktype= kernel binpath= C:\Imdisk.sys" it installs fine, but when I run "sc start Imdisk" it fails with the error 193. The event viewer error showed that this is not a valid win32 application.

I am new to this, but then how can I am able to create and start my driver, but not Imdisk, considering the fact that both are file system drivers (.sys files) ?

I am stuck here and I would really appreciate if there is a way to do manual installation of the Imdisk driver using sc.exe and point out what am I missing ot doing wrong here?

Regards.

#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 07 December 2011 - 09:32 AM

See here:
http://reboot.pro/5531/
Try using IMDISK.EXE to start the service.

Or try using net start imdisk. :unsure:

:cheers:
Wonko

#3 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 07 December 2011 - 09:38 AM

Hi,
I want to install the driver itself (imdisk.sys) to be manually installed and run using sc.exe. I do not want to use the installer provided.
The reason is to simply check and compare my driver which basically creates virtual drives and imdisk. I can use "sc create myDriver type= filesys binpath= C:\myDriver.sys", and then use "sc start myDriver" successfully.

However when I copy just the Imdisk.sys from another clean machine (with no previous imdisk installation), and use the commands "sc create Imdisk type= filesys binpath= C:\Imdisk.sys" or "sc create Imdisktype= kernel binpath= C:\Imdisk.sys" it installs fine, but when I run "sc start Imdisk" it fails with the error 193. The event viewer error showed that this is not a valid win32 application.


First of all, for imdisk.sys, type of service should be "kernel", not "filesys". ImDisk is not in any way a filesystem driver. You could get all sorts of strange phenomenons if you use incorrect service type in this way.

Then, for kernel drivers and filesystem drivers you need to specify native path to sc, not Win32 path. This means that C:\imdisk.sys is an invalid path, it should be for example \??\C:\imdisk.sys or, if driver file is somewhere under Windows directory you can start from there with a relative path such as system32\drivers\imdisk.sys. Notice that driver files are normally installed in <windows>\system32\drivers directory.

I am new to this, but then how can I am able to create and start my driver, but not Imdisk, considering the fact that both are file system drivers (.sys files) ?

I am stuck here and I would really appreciate if there is a way to do manual installation of the Imdisk driver using sc.exe and point out what am I missing ot doing wrong here?


Just copy imdisk.sys to your <windows>\system32\drivers directory. Then type for example:
sc create imdisk type= kernel start= auto error= ignore binPath= system32\drivers\imdisk.sys


#4 aeon_dan

aeon_dan
  • Members
  • 2 posts
  •  
    Singapore

Posted 08 December 2011 - 06:27 AM

Hi Olof,
Thanks for your reply. I copied Imdisk.sys in the "System32drivers" directory, then executed "sc create imdisk type= kernel start=auto error= ignore binpath= system32driversimdisk.sys" which executed successfully as usual. However when I tried to start the service using "sc start Imdisk" or with "net start Imdisk" it failed with error 193 as I had encountered initially. What is wrong here, what am I missing? Can you please help?
FYI, I am testing it on Windows 7 x86 virtual machine on VMware player.

Regards,

#5 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 08 December 2011 - 12:09 PM

Strange then. Error message indicates bad contents of the imdisk.sys file. Are you sure that you are using the correct version, the one from i386 subdirectory in distribution archive? Are you sure that no antivirus software etc are blocking loading of driver binaries or something?

#6 redsun

redsun
  • Members
  • 6 posts
  •  
    Vietnam

Posted 05 February 2012 - 05:22 AM

Hi,

Let me ask you a question in case I want to install imdisk.sys manually.

How do I do digital signature for imdisk.sys driver? In imdiskinst.exe , it seems there's some information about digital signature?
Thank you in advance.

M.Truong.

#7 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 05 February 2012 - 08:15 AM

No, it's just that someone suggested that I should sign imdiskinst.exe as well. Just so that one could check that it was packaged by me. But it is the .sys files that actually need to be and are signed. So just pick imdisk.sys and register it with sc.exe. It should work.

#8 redsun

redsun
  • Members
  • 6 posts
  •  
    Vietnam

Posted 05 February 2012 - 10:58 AM

Hi Olof Lagerkvist,


Thank you for your answer. I just don't want these thing when users install imdisk driver with my program.


1. This message: Because I want to inform user installation succeeds at the end, not when imdisk driver is successfully installed.

Posted Image

2. Right click menu: Because I don't want users accidentally unmount imdisk disk. I want users to unmount disk via my program.

Posted Image

I might annoy you, but could you please tell me how to config these things or could you please package for me?

Thank you in advance.

#9 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 05 February 2012 - 11:20 AM

If you don't use the cmd script for install you won't get the message box at end of ImDisk install.

You could just install imdisk.sys manually. Either using sc.exe command line tool or through SCM API. Or as an alternative, you could use imdisk.inf but just comment out the things that install Explorer context menu items. Should be pretty ovious which lines it is if you open imdisk.inf in notepad.

#10 redsun

redsun
  • Members
  • 6 posts
  •  
    Vietnam

Posted 05 February 2012 - 01:55 PM

Hi Olof Lagerkvist,

I did change imdisk.inf file, use 7-zip to create installer... but I failed.
Because I did not uninstall correctly so I could not intall correctly.

Before uninstall, we must stop service...but I did not (stupid mistake :) )

Now, I could create new custom installer.
Thank you very much for your smart way (digital sign only .sys files)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users