View Single Post
  #3  
Old 14-11-2019, 13:08
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,689
Thanks: 1,106
Thanked 7,336 Times in 2,838 Posts
KaktoR is on a distinguished road
In script.iss search for
Code:
procedure SystemReq();
I used functions from ISSysInfo.dll from peterf1999.

I can't explain all of this to you.

Some example from the code
Code:
if (GetCpuMaxClockSpeed) < Processor then begin
    CPUNameLabel.Font.Color := ColorConverter(GetValInt('SystemRequirement', 'HWNotOkLabelColor', 0));
    CPUNameLabel.Caption := 'CPU: '+IntToStr(GetCpuMaxClockSpeed)+' MHz,' + (ExpandConstant('  {cm:DirectXNeeded} ')) + '{#Processor}'+' MHz';
  end;
Code:
GetCpuMaxClockSpeed
Get max clock speed of your CPU. You find it by default in ISSysInfo.iss
Processor variable takes info from {#Processor} ISPP (which you can find in Settings.iss, which reads input directly from Settings.ini).
So if detected CPU max clock speed is lower (<) then Settings.ini input, label (HWNotOkLabelColor) is in red color (default). In fact you can change the color of HWNotOkLabelColor label in Settings.ini (this is also a ISPP). The ColorConverter only change color codes from BGR (Blue, Green, Red) to RGB (Red, Green, Blue). Inno's standard is BGR, which I find not really good.

CPUNameLabel.Caption is just the label for CPU.

Code:
'CPU: '+IntToStr(GetCpuMaxClockSpeed)+' MHz,'
However you have to convert the CPU MHZ number from integer to string (IntToStr) to display MHZ correctly.

Code:
(ExpandConstant('  {cm:DirectXNeeded} '))
Don't get confused here. This is just a custom message for the word "Required", but I was too lazy to change it to something more accurate lol.

Code:
'{#Processor}'+' MHz'
Display your input in Settings.ini for Processor= and add MHz after this.


Most of the other parts from the 'procedure SystemReq' are just variables or text/labels/fancy stuff which is not really needed but it looks better
---

I always tried to made the scripts as clear as possible to give a fast overview, eventough everybody works a bit different and has a bit different characteristics.
__________________
Haters gonna hate
Reply With Quote
The Following 2 Users Say Thank You to KaktoR For This Useful Post:
artexjay (16-11-2019), Behnam2018 (26-02-2020)