Jump to content

GCOND


Recommended Posts

How can I get WPI to check the contents of a string within the registry.

I have 3 different versions of anti virus software and I would like WPI to grey out the version that is installed.

The only thing that I can see that is different from each of the installs is the content of the registry string located at:

HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\DatabasePath

The values I get for the DatabasePath String are either of the following:

\\CIV-AV-01\ofcscan\FileDB

\\MOR-AV-01\ofcscan\FileDB

\\SSD-AV-01\ofcscan\FileDB

I would like WPI to grey out the entry for CIV anti virus if the registry string = \\CIV-AV-01\ofcscan\FileDB

I would like WPI to grey out the entry for MOR anti virus if the registry string = \\MOR-AV-01\ofcscan\FileDB

I would like WPI to grey out the entry for SSD anti virus if the registry string = \\SSD-AV-01\ofcscan\FileDB

If no registry string called DatabasePath exists, then do nothing, ie leave all options available within WPI.

I have looked at various posts regarding gcond, but haven't found any that specifically check the contents of the registry key/string/dword etc.

Can anyone help me?

Link to comment
Share on other sites


part of answer could be found here

not tested , because @Lawrenca do not give me an answer

and already i have implemented other method for eliminate regs gcond error.

i run an autoIT script before launch WPI

and if reg condition is true , then the autoIT script create for me

a file, like KBxxxxxx.log , in a specific place (c:\windows\debug, folder here)

and my gcond use FileExist() function , who never give me errors.

if you want to test @Lawrenca way , let me know if works.

Link to comment
Share on other sites

I have tried that method and had no luck with it. It seemed to make the statement true is the key DatabasePath was found and din't actually look at the value and base it's true/false condition based on that.

I don't really want to use autoIt as I understand that requires another scripting library to be registered and this is for a corporate build so wouldn't really be appropriate.

Shame WPI don't seem to do this sucessfully or shame I am a doughnut and can't work it out.

Link to comment
Share on other sites

I don't really want to use autoIt as I understand that requires another scripting library to be registered and this is for a corporate build so wouldn't really be appropriate.

You can compile autoIt script into a self-contained .exe, therefore not needing to install or register any libraries.

Link to comment
Share on other sites

I have tried that method and had no luck with it. It seemed to make the statement true is the key DatabasePath was found and din't actually look at the value and base it's true/false condition based on that.
would be nice in the future when you ask some

to point the unsuccesfull tries.

then a lot of us can learn from your experience and maybe other can spare time.

I don't really want to use autoIt as I understand that requires another scripting library to be registered and this is for a corporate build so wouldn't really be appropriate.
autoIT is 100% free and like @zorphnog said

an .exe file is just an .exe file .

Shame WPI don't seem to do this sucessfully or shame I am a doughnut and can't work it out.
WPI is an open project , more people work hard and spend a lot of time to improve it, test it,

and if any person blame WPI without reasons, this do not contribute in any way in WPI developing.

returning to your specific problem , like i said, and others said before me, gcong has a problem with read regs.

in this moment WPI had other major problems , so i advice you for twice , to use other way.

probably after a stabilised version of WPI , a lot of minor issues like this will be solved properly.

if you want i can attach for you my autoIT script.

Link to comment
Share on other sites

  • 2 weeks later...
would be nice in the future when you ask some

to point the unsuccesfull tries.

then a lot of us can learn from your experience and maybe other can spare time.

You are 100% correct and I apologise for not saying this at the start.
autoIT is 100% free and like @zorphnog said

an .exe file is just an .exe file

How do I do this guys?

WPI is an open project , more people work hard and spend a lot of time to improve it, test it,

and if any person blame WPI without reasons, this do not contribute in any way in WPI developing.

returning to your specific problem , like i said, and others said before me, gcong has a problem with read regs.

in this moment WPI had other major problems , so i advice you for twice , to use other way.

probably after a stabilised version of WPI , a lot of minor issues like this will be solved properly.

if you want i can attach for you my autoIT script.

I wasn't critising WPI at all, I think it is a great project and really usefull. To be honest I thought it was something I was doing wrong and now WPI's fault at all. I will try and be more constructive in future though, thanks for the kick up the backside.

If you could post me your compiled autoIT script that would be really useful.

Link to comment
Share on other sites

gcond[pn]=['try{WshShell.regRead("HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\DatabasePath") == "\\CIV-AV-01\ofcscan\FileDB" ? true : false}catch(ex){;}'];

gcond[pn]=['try{WshShell.regRead("HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\DatabasePath") == "\\MOR-AV-01\ofcscan\FileDB" ? true : false}catch(ex){;}'];

gcond[pn]=['try{WshShell.regRead("HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\DatabasePath") == "\\SSD-AV-01\ofcscan\FileDB" ? true : false}catch(ex){;}'];

Have you tried them this way? Post what you have tried.

P.S.: You will have to double backslash each backslash: \ -> \\ \\ -> \\\\

Edited by mritter
Link to comment
Share on other sites

My registry at HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\DatabasePath = \\CIV-AV-01\ofcscan\FileDB

It is Type REG_SZ.

I have tried the following, but WPI is just greying out all 3 entries:

gcond[pn]=['try{WshShell.regRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\TrendMicro\\PC-cillinNTCorp\\CurrentVersion\\DatabasePath") == "\\\\CIV-AV-01\\ofcscan\\FileDB" ? true : false}catch(ex){;}'];

gcond[pn]=['try{WshShell.regRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\TrendMicro\\PC-cillinNTCorp\\CurrentVersion\\DatabasePath") == "\\\\MOR-AV-01\\ofcscan\\FileDB" ? true : false}catch(ex){;}'];

gcond[pn]=['try{WshShell.regRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\TrendMicro\\PC-cillinNTCorp\\CurrentVersion\\DatabasePath") == "\\\\SSD-AV-01\\ofcscan\\FileDB" ? true : false}catch(ex){;}'];

My 3 entries in WPI are:

1. Trend - Civic

2. Trend - Moorside

3. Trend - SSD

Can someone help me please? Is it something I am doing or an issue with the version of WPI I am using? The version I am using is 5.0.1 at the moment, am about to change to the latest, but need to iron out a few other issues with my automaed install 1st.

Mark, help me please, this is doing my head in. Can anyone get this to work? You don't need to install the software to check, just create the registry key manually.

Link to comment
Share on other sites

I've tested it out on my computer and it works fine. Are you entering the gcond entry through the configuration wizard or are you editing your config file? If you are editing the config file manually then the code you supplied should work.

If you're entering through the configuration editor, don't use double backslashes as they will be doubled by WPI in the parsing process (i.e. "HKEY_LOCAL_MACHINE\\SOFTWARE\\TrendMicro\\PC-cillinNTCorp\\CurrentVersion\\DatabasePath" becomes "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\TrendMicro\\\\PC-cillinNTCorp\\\\CurrentVersion\\\\DatabasePath").

Type the following in the gcond textbox:

try{WshShell.regRead("HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\DatabasePath") == "\\SSD-AV-01\ofcscan\FileDB" ? true : false}catch(ex){;}

I did it this way and it works perfectly.

Edited by zorphnog
Link to comment
Share on other sites

Thank You, Thank You, Thank You I thought I was going mad. It is always such a simple thing that can take ages to resolve.

I was doing it within the configuration editor and didn't realise that it automatically added more back slashes.

Link to comment
Share on other sites

...If you could post me your compiled autoIT script that would be really useful.

sorry , over 2 weeks holiday .

but never isnt too late.

the script is up to date (including august hotfixes)

for every installed hotfix , create a file kbxxxxxx.log in

c:\windows\debug (%windir%\debug , in fact)

i choose this , because i am a ccleaner fan, and ccleaner use to delete

all logs from systemdrive , including those with same names kbxxxxxx.log

created by hotfixes during instalation in c:\windows folder.

so i use in WPI something like

prog[pn]=['Update 10 : KB893803 .(s)'];

ordr[pn]=[869];

desc[pn]=['....'];

uid[pn]=['KB893803'];

dflt[pn]=['no'];

cat[pn]=['Critical UpDates XP32 SP3'];

forc[pn]=['no'];

configs[pn]=['default'];

deps[pn]=['QCHAIN'];

cond[pn]=['getOSver()==XP" && FileExists("%wpipath%\\_WPIapp\\_XP32\\Hotfixes_Critical\\KB893803.exe") && FileExists("%windir%\\Debug\\KB893803v2.log")'];

gcond[pn]=['FileExists("%windir%\\Debug\\KB893803v2.log")'];

cmd1[pn]=['%wpipath%\\_WPIapp\\_XP32\\Hotfixes_Critical\\KB893803.exe /q /n /z'];

picf[pn]=['WinXPUpdate2.png'];

picw[pn]=['128'];

pich[pn]=['128'];

textl[pn]=['Bottom'];

pn++;

all my config.js here post #9

(and some more explanations about my config.js)

if this help you and you need more help just say it.

CloseMyComp.au3

_biblioteca.au3

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