Announcement

Collapse
No announcement yet.

Check VM

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Check VM

    Dear Setup Factory Team and Users,

    I'm currently working on a setup and would like to check during the installation, if the setup is performed on a virtual machine or not.

    Using the windows commands: Wmic computersystem get model and Wmic computersystem get manufacturer I am able to check for specific strings like Virtual machine or similar.

    Unfortunately, I couldn't find a similar method in the Setup Factory Help or in the internet. Do you have suggestions how to check it? Or do you have any other suggestions?

    Thank you very much in advance.

    Best regards from Berlin,

    Daniel

  • #2
    You can use the same code in Setup Factory. You can use File.Run(), for example, and direct the output to a text file, and read the contents of that file, then delete it, for example.
    You can also run the commands directly and pipe the output into tables, and then use the desired lines (positions) as desired.

    Click image for larger version

Name:	SCRN-2021-09-21-01.png
Views:	140
Size:	34.7 KB
ID:	307678

    Ulrich

    Comment


    • #3
      Hi Ulrich,

      thank you very much for your prompt reply and the examples! I will try it out immediately.

      Thanks and best regards,

      Daniel

      Comment


      • #4
        You can also use the Registry actions to read the values stored at HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIO S, as it appears that everything you need is there. It would be much easier than running a program and retrieve its output:

        Click image for larger version  Name:	SCRN-2021-09-22-02.png Views:	0 Size:	7.1 KB ID:	307687

        Example:

        Code:
        local sBrand = Registry.GetValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\BIOS", "SystemManufacturer");
        local sModel = Registry.GetValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\BIOS", "SystemProductName");
        
        Dialog.Message("Info", sBrand .. " " .. sModel, MB_OK, MB_ICONINFORMATION);
        Ulrich

        Comment


        • #5
          Hi Ulrich,

          thanks for your new message! That's indeed even easier than the previous approach. I could obtain the manufacturer + model using your example code and concatenate them into one character string.

          Using String.Find I'm able now to track, if terms like VM, Virtual or similar are appearing in the character string and Screen.Jump accordingly.

          Thanks again for your help!

          Best regards,

          Daniel

          Comment

          Working...
          X