Jump to content

Config-Dependencies-GrayedCondition-FileVersionGreaterThan


Recommended Posts

Hello,

First, love the tool....hoping to put it to good use after testing and resolving all issues.

Two Questions:

1. Using WPI 8.1.0 and attempting to use the File System - File - FileVersionGreaterThan condition but cannot get it to work.

I can successfully use the FileExists, or FolderExists, or GetFileVersion conditions.

Using Adobe Acrobat Reader as an example, once installed, the file version is 9.3.0.148.

If I use the Grayed Condition of FileVersionGreaterThan("9.3.0.147",getFileVersion("C:\Program Files\Adobe\Redaer 9.0\Reader\AcroRd32.exe")), the Application Entry for Adobe Reader is not Grayed Out and the color does not change.

2. In the Help File, for "Dependencies" and "Grayed Condition", is states "the entry's color is changed, or can be disabled".....my question is when specifying a Grayed Condition, how can I indicate that I would like the entry to be disabled rather than the color changing? Also, if I want the entry color to change, can you tell me where I can specify what color I would like the entry to change to when meeting the Grayed Condition?

Thanks in advance....

Geemail

Link to comment
Share on other sites


FileVersionGreaterThan("9.3.0.147",getFileVersion("C:\Program Files\Adobe\Redaer 9.0\Reader\AcroRd32.exe"))

If this is exactly how you have it in WPI, then the issue is the file path is misspelled. If so, correct it and see if it then works.

As for the disabling check box if condition is not meet, its under Option>Features>If grayed condition is true, disable the check box

Link to comment
Share on other sites

Sorry about that....I do have the path correctly spelled in WPI....I manually typed the posting and fat fingered it. Any other thoughts as to why I can't get FileVersionGreaterThan to work as a condition?

Thanks for the pointer to the Disabling Checkbox....it works perfectly.

Link to comment
Share on other sites

OK I went to try this feature out for the first time myself, downloaded reader so I could see if I could get the same results. Guess what? I did after placing it in the grayed condition box, but it worked perfectly if placed in the condition box that simply doesn't display the item if the condition is meet. After a bit of playing around I came across a solution that worked for me, seems the 2 boxes work differently if the out come of the argument is true... crazy!!!

The only variables I had that differs from you is a higher version number of reader and running on a 64 bit system, but these should work for you

Using this string I had no issues in the condition box:

fileVersionGreaterThan("9.3.3.178",getFileVersion("C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe"))

But this string seems to be what is needed for the grayed condition box:

fileVersionGreaterThan("9.3.3.178",getFileVersion("C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe"))==false

Now the issue you're going to face is running that string across both 32 and 64 bit Windows, since I am assuming the file location differs from "Program Files" as apposed to "Program Files (x86)"

Two solutions I can off think that might work. Firstly to have 2 entries linking to the same install and condition them as getBits()==64 and 32, then grayed condition as getFileVersion "Program Files (x86)" and "Program Files" accordingly. This in theory should not show 1 entry at all based off what bit OS you are using, while the second will show and then grey out if the file version is greater than.

The other is to have a complex string in the greyed conditions that's getBits && fileVersion || getBits && fileVersion, based off the different file structure for 32 and 64 bit OS.

Hope this is of help to you, let me know if it works.

Link to comment
Share on other sites

Edit grayed color in the theme's style sheet. As you saw, it is set globally, not per item.

-------------------

Don't use literal paths: C:\ProgramFiles]Adobe\....

Use %programfiles%\Adobe\......

That will help straighten out x86/x64 issues/

-------------------

FileVersionGreaterThan() can be finicky if actual version and comparison version don't have same number of sub-versions:

9.3.4.10 != 9.2

fileVersionGreaterThan("9.3.3.178",getFileVersion("C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe"))==false

works, but use:

!fileVersionGreaterThan("9.3.3.178",getFileVersion("C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe"))

Link to comment
Share on other sites

GhostAvatar and Mr. Ritter...

Thank you both for your input....

GhostAvatar....I have tested exactly as you said and the following did indeed work for the file version verification for Adobe Reader.

fileVersionGreaterThan("9.3.3.178",getFileVersion("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"))==false

Mr. Ritter.....I had already tested the above recommendation by the time I got to your recommendation....I will take your recommendation about specifying the %programfiles% variable for Program Files along with the recommended syntax for specifying the Grayed Condition as follows:

!fileVersionGreaterThan("9.3.3.178",getFileVersion("%programfiles%\Adobe\Reader 9.0\Reader\AcroRd32.exe"))

Also Mr. Ritter....can you tell me which section of the theme's style sheet controls the grayed color....I am using the Windows Theme and looked at the install.css and I see the following section:

.WPI_Text

{

color: GrayText;

is there where I would specify a color?

Finally....one other thing....using Adobe as an example....I have the Adobe Reader install, then an Adobe Reader Update install....i have wrapped them both together as seperate commands of an application, so when selected, it installs Adobe Reader and when finished, it installs the Adobe Update. The Reader installation is an MSI which on my test computer when it launches, I get the windows Open File Dialog Box and I can select Open and it installs Adobe Reader, then the Adobe Update begins and again, I get the windows Open File Dialog and I can select Open and it installs. I know I can remove the check mark for each file type and then that machine won't prompt again but I would like to automate this and somehow either prevent the Open File Security Warning box or somehow automate the choice to select Open and thereby allowing the string of installations to be automated rather than interuppted by the windows security prompt. Any ideas for circumventing the dialog box?

Thanks again for both of your help with this....it is slowly coming together....

Geemail

Link to comment
Share on other sites

Don't use literal paths: C:\ProgramFiles]Adobe\....

Use %programfiles%\Adobe\......

That will help straighten out x86/x64 issues/

Sorry but I think that is wrong

%programfiles% does not work on a 64 bit version of Windows, since by default almost all 32 bit apps (Reader included) are installed to %programfiles(x86)%

So you're still going to face the issue of no grayed condition when running on 64 bit Windows, since the check will look for the file in %programfiles% find nothing and return a value of -1 (if I am reading the literature right). When in fact the file does exist and resides in %programfiles(x86)%, so without checking %programfiles(x86)% as well you will never get a greyed condition even if you have a higher version on a x64 platform.

The only benefit I can see of using System paths instead of literal paths is in cases where the defaults have been changed in the registry.

But this should work for both x86 and x64

getBits()==64 && !fileVersionGreaterThan("9.3.3.176",getFileVersion("%programfiles(x86)%\Adobe\Reader 9.0\Reader\AcroRd32.exe")) || getBits()==32 && !fileVersionGreaterThan("9.3.3.176",getFileVersion("%programfiles%\Adobe\Reader 9.0\Reader\AcroRd32.exe"))

Yet to try it on a 32 bit system, but works on a 64 bit.

Edited by GhostAvatar
Link to comment
Share on other sites

geemail.email seems I misunderstood your first request, you wanted the check box disabled AND color changing.

To do so you need to be looking in wpi.css and not install.css inside the theme folder of your choice. Look for the entry .grayTxt_logo there you can change the color or if you wish delete the line color: #123456; to inherit the standard color.

As for the file warning, I ain't come across that on Reader, but have on other files. I have yet to look into overcoming this myself, but if I figure it out before someone else posts a solution I will let you know.

Link to comment
Share on other sites

In wpi.css there are 2 entries for each type of text, so change them both. Traditional one is:

.grayTxt

{

font-family: arial;

font-weight: bold;

color: #A0522D;

font-size: 8pt;

}

%programfiles% is checked by Windows automatically. Say for an installer, it doesn't know where to install, so Windows checks what it is (x86 or x64) and puts in the correct Program Files folder. It does the same with checking, it checks both folders behind the scenes.

Link to comment
Share on other sites

Well I am sat here on Win 7 64 bit and I cant get this to work at all

!fileVersionGreaterThan("9.3.3.177",getFileVersion("%programfiles%\Adobe\Reader 9.0\Reader\AcroRd32.exe"))

But this works perfectly fine

!fileVersionGreaterThan("9.3.3.177",getFileVersion("%programfiles(x86)%\Adobe\Reader 9.0\Reader\AcroRd32.exe"))

I have installed and uninstalled it several times.

The only way I have managed to get your way to work was to make a copy the file structure from the x86 folder in the programme files folder, then copy the file over and hitting F5.

Edited by GhostAvatar
Link to comment
Share on other sites

Doh! on my part. It has been so long since I actually did this. I had in my head Windows checked both automatically, but now that I see your second example with %programfiles(x86)%, it came back to me.

Try this, one long line:


[color=#1C2837][font=verdana, arial, tahoma, sans-serif][size=2]!fileVersionGreaterThan("9.3.3.177",getFileVersion("%programfiles(x86)%\Adobe\ Reader 9.0\Reader\AcroRd32.exe")) || [/size][/font][/color][color=#1C2837][font=verdana, arial, tahoma, sans-serif][size=2]!fileVersionGreaterThan("9.3.3.177",getFileVersion("%programfiles%\Adobe\ Reader 9.0\Reader\AcroRd32.exe"))[/size][/font][/color]

That will check both folders using the || for OR.

Link to comment
Share on other sites

In any normal case you would have been right about the %ProgramFiles% since it doesn't remain fixed in a 64 bit environment, the only fixed variables that exist are %ProgramFiles(x86)% and %ProgramW6432% which direct the path to the 32 and 64 folder respectively. %ProgramFiles% is handled by WoW64 redirection based on the process requesting the variable is itself 32 bit or 64 bit. Check it out yourself by putting %ProgramFiles% in the URL of both 32 bit and 64 bit version of IE to see this effect.

Now in theory since wpi is running as 32 bit, it should always take you to the 32 bit folder based on WoW64 redirection in a 64 bit system and as normal in a 32 bit system. But in reality somehow when it is doing this check in a 64 bit system it is seen as a 64 bit process, I am assuming this is because the call out is done via a script.

Link to comment
Share on other sites

Ahhh that explains it, WPI is running as a 32 process but MSHTA is running as 64 bit process on a 64 bit system. So I assume that the call to Windows for %ProgramFiles% is made via MSHTA and hence why it redirects to the 64 bit folder and not the 32 as one would assume.

Link to comment
Share on other sites

Again...thanks for all this info

Couple of follow up items:

Mr. Ritter:

1. I was able to get the following code to work for the grayed cond:

fileVersionGreaterThan("9.3.3.177",getFileVersion("%programfiles(x86)%\Adobe\ Reader 9.0\Reader\AcroRd32.exe")) || !fileVersionGreaterThan("9.3.3.177",getFileVersion("%programfiles%\Adobe\ Reader 9.0\Reader\AcroRd32.exe"))

Two things to note...the code as you listed it contained a space before "Reader 9.0" which I removed, also the code you listed showed

[color=#1C2837][font=verdana, arial, tahoma, sans-serif][size=2]

Did you intentionally specify the color, font and size code? I was unable to get the code to work when I included the color, font and size settings.

2. In WPI\Themes\Windows\wpi.css I changed the color in the following entry:

.grayTxt

{

font-family: arial;

font-weight: bold;

color: #AA0000;

font-size: 8pt;

}

a. On a 17" monitor at 1024x768 the font size was a little small and hard to read at 8pt....will increasing the font-size have any adverse effect on the rest of the layout?

b. You mentioned "In wpi.css there are 2 entries for each type of text", with the above being the "Traditional" one. I am not sure what you mean here, what is the other text you are referring to?

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...