Announcement

Collapse
No announcement yet.

Processor, Memory, OS, SSD and TPM information

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

  • Processor, Memory, OS, SSD and TPM information

    Hi,

    I am trying to create an installer that checks to see if the current hardware meets minimum system requirements.
    In order to do this I need to processor, total physical RAM, operating system version and also mainly SSD and TPM information.

    I have searched the forums but i haven't found a function that will give me this information's like SSD and TPM

    Does anyone have any idea how i might accomplish this using NSIS script?

  • #2
    https://nsis.sourceforge.io/HwInfo_plug-in and http://forums.winamp.com/showthread.php?threadid=139639 should get you started.

    WinVer.nsh for the Windows version.

    SSD might need WMI or something like that. I have no clue about TPM but if the software you are installing uses the TPM then I'm sure you know which API to call...
    IntOp $PostCount $PostCount + 1

    Comment


    • #3
      Originally Posted by Mike-Sean View Post
      In order to do this I need to processor, total physical RAM, operating system version and also mainly SSD and TPM information.
      What do you need?

      - CPU Name, Speed?
      - Total RAM
      - OS Name, Version
      - SSD -> What info? Name, size, type?
      - TPM -> Active or Not?

      Most of that info can be easily gathered.
      As far as I know, TPM info can be obtained using WMI (Win32_TPM class)

      Ps: Maybe I will create simple plugin that show such info... need to find time and I wonder if there are more people that would like to see such plugin for NSIS
      -Pawel
      OFICJALNY POLSKI PAKIET JĘZYKOWY WINAMPA

      Polski Pakiet Językowy Winampa 5.92.0.10042
      (WINAMP 5.92.0.10042)
      Polski Pakiet Językowy Winampa 5.6.6.3516 (WINAMP 5.6.6.3516)

      WINAMP PL | NSIS PL | WINAMP ICON PACKS | WINAMP COLOR THEMES | ULTIMATE FILE MANAGER

      !!! PLEASE DONATE !!!

      Comment


      • #4
        Hi Thanks for your reply.

        Yes i need a plugin which gives all these information like :
        - CPU Name
        - Total RAM - In GB
        - OS Name, Version
        - SSD -> Need Name of the SSD and Type
        - TPM -> Need Active or not and type or Name of TPM.

        It would be great if you provide me this plugin information.

        Comment


        • #5
          And i have added the below powershell script to get the SSD info:
          ForEach ($disk in (Get-PhysicalDisk | Select-Object FriendlyName, MediaType)){
          If ($disk.MediaType -eq 'SSD'){
          $SSDName = $disk.FriendlyName
          Write-host "SSD name " : $SSDName
          break
          }
          }

          This script i called from my .nsi script but how do i get the actual output from powershell to nsi script and get displayed?

          Comment


          • #6
            The nsExec plug-in can catch stdout strings.

            Alternatively you can write it to a .ini in $pluginsdir. Make PS output something like
            [ssd]
            0=name1here
            1=name2here
            and use the NSIS ini functions to read 0..N-1
            IntOp $PostCount $PostCount + 1

            Comment


            • #7
              I have written Nsis script like below:
              Push $R0
              nsExec::ExecToStack 'powershell -inputformat none -ExecutionPolicy RemoteSigned -File ""$EXEDIR\GetHWInfo1.ps1""'
              Pop $R0

              ${If} $R0 == '0'
              MessageBox MB_OK "SSD exists"
              ${Else}
              MessageBox MB_OK " SSD not exists"
              ${EndIf}

              Is this correct?

              Comment


              • #8
                I don't know what your script looks like but you are checking the powershell.exe exit code and you are missing a pop.

                PHP Code:
                Section 
                nsExec
                ::ExecToStack '"$sysdir\cmd.exe" /C echo Hello World %random%'
                Pop $0
                Pop 
                $1
                MessageBox MB_OK 
                'Process exit code: $0$\n$\nStdOut: $1'
                SectionEnd 
                IntOp $PostCount $PostCount + 1

                Comment


                • #9
                  Hi Pawel,

                  Did u get a chance to create the Plugin for the above data?

                  Comment


                  • #10
                    Originally Posted by Mike-Sean View Post
                    Did u get a chance to create the Plugin for the above data?
                    I am slowly trying to create something... But, it will take few more days...

                    You can check the follwoing demo. It should get info for Operating System and TPM

                    Ps: I am not promising anything more soon... However, I am planning to add CPU/RAM and maybe Storage info tomorrow....

                    Edit: Link removed. See below.
                    Last edited by Pawel; 28 September 2022, 13:02.
                    OFICJALNY POLSKI PAKIET JĘZYKOWY WINAMPA

                    Polski Pakiet Językowy Winampa 5.92.0.10042
                    (WINAMP 5.92.0.10042)
                    Polski Pakiet Językowy Winampa 5.6.6.3516 (WINAMP 5.6.6.3516)

                    WINAMP PL | NSIS PL | WINAMP ICON PACKS | WINAMP COLOR THEMES | ULTIMATE FILE MANAGER

                    !!! PLEASE DONATE !!!

                    Comment


                    • #11
                      SysInfo 1.0 Plugin for NSIS is now ready to test.

                      Plugin should run in Windows 7/8/10/11 with NSIS (unicode).
                      Current version of plugin allows you to get the following data:

                      OPERATING SYSTEM
                      OS Caption | Manufacturer | Version | Build Number | Language | Locale | Code Set |
                      Country Code | Edition ID | Display Version | Current Build Number | UBR | ReleaseID


                      PROCESSOR (CPU)
                      CPU Name | Description | Family | Manufacturer | Number of Cores | Number of Logical Processors |
                      Architecture | Clock Speed | External Clock Speed | L2 Cache Size | L3 Cache Size


                      MEMORY
                      Total Physical Memory | Free Physical Memory | Used Physical Memory
                      Total Virtual Memory | Free Virtual Memory | Used Virtual Memory
                      Total PageFile Memory | Free PageFile Memory | Used PageFile Memory
                      Total Installed Memory | Total Reserved Memory


                      STORAGE DEVICE
                      Disk Name | Disk Serial Number | Disk File System | Disk Drive Type | Disk Media Type
                      Disk Drive Total Size | Disk Drive Free Space | Disk Drive Used Space
                      Drive Media Type | Drive Model | Drive Description | Drive Manufacturer | Drive Serial Number
                      Drive Interface Type | Drive Media Type | Drive Total Cylinders | Drive Tracks/Cylinder
                      Drive Total Tracks | Drive Sectors/Track | Drive Total Sectors | Drive Bytes/Sector |
                      Drive Total Heads | Drive Size


                      TRUSTED PLATFORM MODULE
                      IsActivated_InitialValue | IsEnabled_InitialValue | IsOwned_InitialValue |
                      SpecVersion | ManufacturerVersion | ManufacturerVersionInfo | ManufacturerId | PhysicalPresenceVersionInfo


                      Please, take a look into attached demo script, where you can see how to use it.

                      -Pawel
                      Attached Files
                      Last edited by Pawel; 28 September 2022, 15:02.
                      OFICJALNY POLSKI PAKIET JĘZYKOWY WINAMPA

                      Polski Pakiet Językowy Winampa 5.92.0.10042
                      (WINAMP 5.92.0.10042)
                      Polski Pakiet Językowy Winampa 5.6.6.3516 (WINAMP 5.6.6.3516)

                      WINAMP PL | NSIS PL | WINAMP ICON PACKS | WINAMP COLOR THEMES | ULTIMATE FILE MANAGER

                      !!! PLEASE DONATE !!!

                      Comment


                      • #12
                        Originally Posted by Pawel View Post
                        PROCESSOR (CPU)
                        Which CPU does it get this information from? We now have asymmetrical CPUs (A.K.A big.LITTLE). Intel calls these cores P-Cores and E-Cores and they are effectively different CPUs inside a single CPU chip. On top of this Windows Server probably supports hot-swapping CPUs.

                        A few suggestions:

                        Support queries for specific CPUs. Just naming these is hard. One solution is processor groups. When there are more than 64 cores there will be multiple groups. Input like "1.5" would mean core #5 in group #1. This scheme is annoying for the caller and maybe even annoying to implement with WMI but is easy with raw Win32. The other would just be a simple number ("winmgmts:root\cimv2:Win32_Processor='cpu0'"). Or support both.

                        Something to help the OP here: GetFastestCPUMaximumCoreSpeed and GetSlowestCPUMaximumCoreSpeed. This should cover P-Cores vs E-Cores? For a game you probably only care about GetFastestCPUMaximumCoreSpeed.
                        IntOp $PostCount $PostCount + 1

                        Comment


                        • #13
                          Not wanting to mess with CPU specifics, I made a wiki page that dumps some information. (No TPM support since I don't have one)
                          IntOp $PostCount $PostCount + 1

                          Comment


                          • #14
                            Originally Posted by Anders View Post
                            Support queries for specific CPUs.
                            There is a problem with devices that are more then 1 (CPU or Graphic Card, etc)
                            I still don't know what would be the best for script user (dll caller).

                            Maybe:
                            CPU Name 1 | CPU Name 2
                            CPU Speed 1 | SPU Speed 2

                            But, user would have to know there are more then 1 device and would have to split it by "|".
                            Graphic Card is a good example (it can be gpu buil-in CPU and external dedicated gpu). Maybe the answer is to chose active (default) and display info only for that one...
                            How do you think?
                            OFICJALNY POLSKI PAKIET JĘZYKOWY WINAMPA

                            Polski Pakiet Językowy Winampa 5.92.0.10042
                            (WINAMP 5.92.0.10042)
                            Polski Pakiet Językowy Winampa 5.6.6.3516 (WINAMP 5.6.6.3516)

                            WINAMP PL | NSIS PL | WINAMP ICON PACKS | WINAMP COLOR THEMES | ULTIMATE FILE MANAGER

                            !!! PLEASE DONATE !!!

                            Comment


                            • #15
                              For graphic cards it probably makes sense to return information for the default/currently active. Perhaps a parameter that you set to "" for the default or a number/index for a specific GPU if the user wants to check all of them.

                              For CPUs the same somewhat applies although my suggestion for GetFastestCPUMaximumCoreSpeed should check all the CPUs and just return a usable number. I don't like the | pipe idea. Just using "" as input for some kind of default and an index or group/index pair for a specific CPU. What is the default? Who knows. Up until 2021 it did not matter much, most people just took the information from whatever CPU your thread is currently on but with the introduction of P/E cores you actually need to be specific in your internal code and should probably return the fastest CPU as the default.
                              IntOp $PostCount $PostCount + 1

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎