Jump to content

select an item (checkbox checked) depending on a fileexists()


Recommended Posts

Hi,

how could I automatically select an item (checkbox checked) depending on a fileexists().

Scenario:

I run a software to check if there is an update available for a specific program, if yes, it creates a flagfile.

If I start WPI, I want to see all the available installs, but the ones where there exists a flagfile I would like to have checkmarked right after WPI was started.

For example:

If there is a file %wpipath%\flags\firefox_flg.txt I would like to have Firefox to be checkmarked in the selection right away.

The other available installs should be listed but not checkmarked for selection by default (because they are not recommended to be done).

If the user then would like to install Thunderbird in addition, he could just select that on his own.

Sorry, it´s hard to describe for me in English ...

Thanks for all your help,

Sputnik089

Link to comment
Share on other sites


  • 3 months later...

Hi Kel,

sorry to come back to this, but I think you did not understand my question/problem.

I checked the conditions tab: When the condition is true it will show the program to be installed on the selection list, if the condition is false it will not even show the program at all (like does not exist).

I checked the "Grayed condition": When the condition there is true the program to be installed will be displayed, but the option to select (install) that is grayed out, so the user could not install the program at all, which is very useful, but will not solve my problem, because:

I want to display all items (the complete list) and want to use the conditions to set or not set the checkmark (not the item).

The user should see all programs (none of them grayed out) and should be able to change the proposed (default) selection that I would like to get from flag files or registry keys.

With your conditions I could change the appearance of he line itself (or gray it out) but not the default checkmarks.

The only way I know right now to get closer to what I would need is to change the config.js file and have a unique configs[pn] section, but to change the config.js file every time (for every update level for example) is a lot of work.

My idea is like:

If FileExists("%wpipath%\flags\firefox_flg.txt") or "HKEY_CURRENT_USER\Software\WPI\Apps\Thunderbird_Install")=="1"

DefaultSetCheckMark = TRUE

Else

DefaultSetCheckMark = FALSE

EndIf

Thanks for all your help,

Sputnik089

Link to comment
Share on other sites

What´s the difference between those two?

For now I am still testing WPI@home - no I am not at work on Sundays :-)

I am looking for a way to:

Install Windows7 unattended (WinToolkit)

download sources (wsusoffline update & Ketarin)

Install Windows Updates & Apps & RegTweaks (both wsusoffline update and WPI)

or if PC is installed since years (like mine)

check for necessary Updates (Filehippo Updatechecker) or own database and

Install necessary Updates (WPI)

To deal with the data I am thinking of a sqlite database (ketarins database extended) or registry keys, that´s where my question comes from.

If I succeed in doing all this and will use this for a non friend (= customer) I will let you know.

If there is no way with those checkmarks please let me know and see my thread as a suggestion for future development.

Thanks again.

Link to comment
Share on other sites

You can't put a condition for the checkbox value but you can put one to disable the checkbox or hide it. If you use WPI to install updates you can use conditions to hide the entries if the application on WPI is equal or older than the one installed on the system.

Link to comment
Share on other sites

Thanks you Francesco,

that´s what my testing of WPI discovered.

So I probably have to test it with the configs[pn] section and put all to a specific config_datetime.js file.

Like for the recommended update: configs[pn]=['datetime'] and then start wpi with

wpi.exe config=config_datetime.js check=datetime

Lets see.

Thanks a lot!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...