We had a major storm through here recently and we suffered damage to the house roof and ceilings. I just received the quote to repair. I’m hoping that a small fraction of the 80,000 odd people that download SDIO and/or Desktop Info every month won’t mind chipping in a few dollars to help out. Click on the big blue button at the bottom of the page to help us keep a roof over our heads, literally!
Guests have read-only access to our forums. If you wish to participate you will need to register. Be sure to activate your account from the email sent to you when you register.
Hi Glenn,
First of all, I love the new BEGIN-IF / END-IF option in v3.20 👍
I've started reworking my INI file, and it's making my life so much easier already.
The one problem I do have though is the removal of CONTROL , and it's replacement with the BUTTON command. Going back many versions, I always had a problem with BUTTON not working correctly with the IF statement, and got round it by using CONTROL instead.
I've tried using both IF and BEGIN-IF, but both have the same result.
BUTTON=button-color:%Orange%,text:Warning:,display:Restart Pending,uri:control,args:/name Microsoft.WindowsUpdate
This is my BEGIN-IF :
I tried the following:
SET RebootPendResult = True IF=value1:%RebootPendResult%,value2:True,comparator:eq BUTTON=button-color:%Orange%,text:Warning:,display:Restart Pending,uri:control,args:/name Microsoft.WindowsUpdate
Which worked fine. My suspicion is %RebootPendResult% does not have the value you think it does. Try enabling the display for the IF item and see what it's actually comparing after it's done replacing variable values:
SET RebootPendResult = True IF=value1:%RebootPendResult%,value2:True,comparator:eq, hidden:0, display:%1 %2 %3 %4 BUTTON=button-color:%Orange%,text:Warning:,display:Restart Pending,uri:control,args:/name Microsoft.WindowsUpdate
%1 = result
%2 = value1
%3 = value2
%4 = comp
Yes, that code does work, but if I try setting the RebootPendResult to False, the button still appears.
If I try the following:
SET RebootPendResult = True
IF=value1:%RebootPendResult%,value2:True,comparator:eq, hidden:0, display:%1 %2 %3 %4
BUTTON=button-color:%Orange%,text:Warning:,display:Restart Pending,uri:control,args:/name Microsoft.WindowsUpdate
SET RebootPendResult = False
IF=value1:%RebootPendResult%,value2:True,comparator:eq, hidden:0, display:%1 %2 %3 %4
BUTTON=button-color:%Blue%,text:Warning:,display:Shouldnt be Restart Pending,uri:control,args:/name Microsoft.WindowsUpdate
I get one orange button, and one blue button.
The display %1 %2 %3 %4 for each results in
True True True eq
False False True eq
I have a second page, and if I go to the second page and go back, both buttons disappear, and the results show as expected.
I've added screenshots to show the results with the two extra IF statements. The first is what happens as soon as DekstopInfo is launched, the second is what happens after I go to page two and back to page one, and is what I would expect it to look like.
This is how it should look, and does look using an older version and the CONTROL command instead of the BUTTON command.
If I change the code slightly, to remove setting the RebootPendResult before the second IF, thi sshould result in the Blue button NOT displaying. Instead, I get the attached.
SET RebootPendResult = True
IF=value1:%RebootPendResult%,value2:True,comparator:eq, hidden:0, display:%1 %2 %3 %4
BUTTON=button-color:%Orange%,text:Warning:,display:Restart Pending,uri:control,args:/name Microsoft.WindowsUpdate
IF=value1:%RebootPendResult%,value2:False,comparator:eq, hidden:0, display:%1 %2 %3 %4
BUTTON=button-color:%Blue%,text:Warning:,display:Shouldnt be Restart Pending,uri:control,args:/name Microsoft.WindowsUpdate
Glenn my man ! You are a genius. Begin-onload/end-onload seems to have cured the problem.
Thank you !!
explanation here: https://www.glenn.delahoy.com/community/desktop-info/onload/#post-3791