|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
|
![]() |
#1 |
Member
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
|
![]()
I run batch file with command:
code: Content batch MyDisks.cmd file: code: Result MyDisks.ini : code: But I do not know how to parse MyDisks.ini file for each item to the RichEdit control. I tried ReadINIStr $0 'D:\MyDisks.ini' 'DiskZZZ' 'Item' but not success ![]() I need content in the RichEdit control same as: code: Please help me. ![]() Thanks. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,177
|
SET "InputFile=MyDisks.ini" is a relative path. Try a full path.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Member
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
|
Yes Anders.
I put MyDisks.cmd in D:\ location. And the output of MyDisks.cmd which MyDisks.ini also in D:\ location |
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,177
|
Your batch-file and ReadINIStr ... "Disk0" work just fine for me when I use full paths.
ExecShellWait '"$SYSDIR\cmd.exe"' should just be '$SYSDIR\cmd.exe' but I assume this is not the real issue. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 | |
Member
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
|
![]()
There are computers with 2 storage devices, 3 storage devices, 4 storage devices, ... So, How do we know how many devices that the computer has ?.
Quote:
Last edited by meoit; 4th July 2019 at 00:18. |
|
![]() |
![]() |
![]() |
#6 | |
Member
Join Date: May 2007
Location: Orange County, CA, U.S.A.
Posts: 58
|
Quote:
Spoiler: code: Assuming you've done that, you'd loop through them, e.g.: Spoiler: code: * * * * * If you need to keep the index as is for some reason, then you'd have to come up with a maximum number beyond which the number of drives is unreasonable. 16, maybe, for a consumer system, but if you might be installing on a server, even though usually you'd expect to find lots of drives hidden behind a RAID pool, theoretically you could have hundreds of disks in a bunch of JBODs, so let's say, 200? e.g.: code: |
|
![]() |
![]() |
![]() |
#7 | |||
Member
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
|
![]()
Thanks Nutzzz.
I edited MyDisks.cmd to count devices as you told. Quote:
Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
#8 |
Member
Join Date: May 2007
Location: Orange County, CA, U.S.A.
Posts: 58
|
As I said, you can't assume the Index value is contiguous, and your new method doesn't resolve that issue. Even if the method was valid, you're missing a where clause to match up the current index with the appropriate caption and size.
Did the replacement section I gave you not work, or are you required to use the Index value for your sections? |
![]() |
![]() |
![]() |
#9 |
Member
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
|
Yes, I need to use Index value and count devices. And I want to read the size, to converte to MB, GB in NSIS, don't handle size in MyDisks.cmd.
|
![]() |
![]() |
![]() |
#10 | |
Member
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
|
Thanks Nutzz.
I fixed code for myself. Quote:
![]() |
|
![]() |
![]() |
![]() |
#11 |
Member
Join Date: May 2007
Location: Orange County, CA, U.S.A.
Posts: 58
|
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|