Menu

Automated Install and starter service

jcrnc
2019-11-13
2019-11-14
  • jcrnc

    jcrnc - 2019-11-13

    Hello,
    I was looking into some options with ImDisk to create an automated Ram Disk drive along with the starter service. It seems that if you use the RamDisk Configuration gui, you can create a disk and choose "Launch at Windows Startup". This creates the ImDisk RamDisk starter service. This works well to ensure the RamDisk is created at startup, but is there a way to create both the drive and service without initially using the configuration gui?

    From the cli I can create a RamDisk as necessary, I can even replicte the service the gui creates, but that service won't create the RamDisk unless it has been created using the gui at least once. If I create it with the gui, then unmount it, the service will create it again, but of course on reboot it won't create the disk the next time.

    I see other options out there with scheduled tasks and command files, it would be ideal if I could programmatically create the disk the first time and rely on the ImDisk RamDisk starter service going forward.
    Thanks

     
  • v77

    v77 - 2019-11-13

    If all the required parameters are in the registry (HKEY_LOCAL_MACHINE\SOFTWARE\ImDisk), the service should be able to create the ramdisk.

    The service can be created with a command such as:
    sc create ImDiskRD binPath= "\"C:\Program Files\ImDisk\RamDiskUI.exe\" SVC" start= auto DisplayName= "ImDisk RamDisk starter" depend= ImDisk
    And then, start it with:
    sc start ImDiskRD

    Do these commands work for you?

     
  • jcrnc

    jcrnc - 2019-11-13

    Hi v77,
    Thanks for the quick response.

    I've created the service exactly like this, but it doesn't seem to create the disk unless I've used the GUI to create the disk first.

    Scenario:
    Create the service above, start the service, disk is not created. Reboot, disk is still not created by the service.

    If I use the RamDisk Configuration GUI to create the disk initially the service will re-create it upon reboot. But if I have to touch the GUI initially to create the disk, I would thenl check the box to create the service as well and not programmatically create the service.

    My hope is to use the CLI to create the initial disk and the service, but doing this does not seem to work as the service won't create the disk unless it was created through the GUI first (unless I'm missing something in the CLI when I create the disk).

    This is the command I use in the CLI to create the disk:
    imdisk -a -s 500M -m H: -p "/fs:ntfs /q /y"

    Thanks again,

     
  • v77

    v77 - 2019-11-13

    I just checked the commands, and they work for me. But one more time, only with the proper registry values, that is, the values created by the GUI.
    The service relies on the registry to know the drive letter and all the options for each registered ramdisk.
    But once you have the registry values, you can save them in a .reg file and then restore them.

    By the way, the installer is also able to recreate the services(s) and the ramdisk(s) if the registry values are present before the installer is started. If you are interested, enter for instance in a command prompt:
    ImDiskTk-x64.exe /?

     
  • jcrnc

    jcrnc - 2019-11-13

    Can you confirm the registry values that are created by the GUI when you create the disk? I'm not able to determine those so far. Does creating the disk using the CLI also set those registry values?

    So far if I manually create the starter service, I cannot get it to create the disk upon reboot whether I create the initial disk with CLI or GUI. The only consistant way is when the GUI creates the disk and the starter service.

    Also, for the installer options, if I run the /? on the installer I only show options for the following switches:
    /silent
    /fullsilent
    /installfolder:"path"
    /lang:name
    * /silentuninstall

     
  • v77

    v77 - 2019-11-14

    Well, it would be a bit complicated to explain how the registry values work, because of backward compatibility, because several ramdisks can be registered to be created at system startup, and so on. But basically, it's all you can find in the mentionned registry key (HKEY_LOCAL_MACHINE\SOFTWARE\ImDisk).
    Some other values can be created if you use MountImg.exe.

    The CLI (imdisk.exe) is part of the driver. It creates no registry value unless you use the -P switch. And in this case, they will be located in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ImDisk.

    About the installer, yes, these are the available switches. For instance, if you use, with all the values of the registry key above,
    ImDiskTk-x64.exe /fullsilent
    it will silently recreate all the services and ramdisks that you have defined to be created at Windows startup. This is meant to be used with automated installations.

     
  • jcrnc

    jcrnc - 2019-11-14

    Thank you v77,
    That makes sense for the registry and I see those now.

    The GUI writes the registry keys but the CLI does not so to use the service I'll need to either generate those registry keys prior to install and use the /fullsilent or create them after and create the service or lastly, manually touch the GUI after installation and enable the drive and startup service there.

    I appreciate your quick responses.
    Thank you again,

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.