This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to get physical memory [RAM] size on the host machine through Installscript
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2017
01:57 AM
How to get physical memory [RAM] size on the host machine through Installscript
Hello,
I have a requirement to throw an error and stop the installation if Physical memory [RAM] is found to be less than 16 GB.
The problem here is based on my research PhysicalMemory property can be used but it has a limitation of checking upto 2GB RAM only. Even if RAM is more than 2GB it will return the available RAM as 2GB.
Secondly, GetSystemInfo also cannot be used as internally it uses PhysicalMemory property only.
I dont want to write a separate C# dll just to detect the memory size before installation begins. Is there anything else i can do?
Please suggest thanks.
I have a requirement to throw an error and stop the installation if Physical memory [RAM] is found to be less than 16 GB.
The problem here is based on my research PhysicalMemory property can be used but it has a limitation of checking upto 2GB RAM only. Even if RAM is more than 2GB it will return the available RAM as 2GB.
Secondly, GetSystemInfo also cannot be used as internally it uses PhysicalMemory property only.
I dont want to write a separate C# dll just to detect the memory size before installation begins. Is there anything else i can do?
Please suggest thanks.
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2017
06:49 AM
dinesh_redhawk wrote:
Hello,
I have a requirement to throw an error and stop the installation if Physical memory [RAM] is found to be less than 16 GB.
The problem here is based on my research PhysicalMemory property can be used but it has a limitation of checking upto 2GB RAM only. Even if RAM is more than 2GB it will return the available RAM as 2GB.
Secondly, GetSystemInfo also cannot be used as internally it uses PhysicalMemory property only.
I dont want to write a separate C# dll just to detect the memory size before installation begins. Is there anything else i can do?
Please suggest thanks.
Solution:
I called the following command which writes the total free RAM size in a text file.
szCmdLine = "/C wmic computersystem get TotalPhysicalMemory >" + szFilePath;
But iam stuck in converting the size of the RAM (in string) to number as it exceeds the NUMBER datatype size limit.
Any guidance please.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2017
07:50 AM
In your case it probably does not need to be exact... so is it good enough to drop the last 6 digits of the string and then convert? Number will be close to amount of RAM in MB.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2017
07:52 AM
rguggisberg wrote:
In your case it probably does not need to be exact... so is it good enough to drop the last 6 digits of the string and then convert? Number will be close to amount of RAM in MB.
I guess, you are right.. Can be done. let me try. You are genius 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2017
09:41 AM
dinesh_redhawk wrote:
I guess, you are right.. Can be done. let me try. You are genius 🙂
I tried, it gives approx value, but my lead is asking to get the exact value...not to depend on approximation.
can you please reply to this thread
https://community.flexerasoftware.com/showthread.php?223068-Parsing-string&p=515469#post515469
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2017
10:24 AM
dinesh_redhawk wrote:
I tried, it gives approx value, but my lead is asking to get the exact value...not to depend on approximation.
can you please reply to this thread
https://community.flexerasoftware.com/showthread.php?223068-Parsing-string&p=515469#post515469
Now that you are using SYSTEMINFO instead of WMIC... we have this covered... right?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 23, 2017
08:25 PM
dinesh_redhawk wrote:
Solution:
I called the following command which writes the total free RAM size in a text file.
szCmdLine = "/C wmic computersystem get TotalPhysicalMemory >" + szFilePath;
But iam stuck in converting the size of the RAM (in string) to number as it exceeds the NUMBER datatype size limit.
Any guidance please.
Solution:
https://community.flexerasoftware.com/showthread.php?223068-Parsing-string
for someone who might need