TASK, Action Script - parameter and if problem

(imported topic written by SystemAdmin)

Hello

i try to deploy a software package with different parameters based on the manufacturer.

The line with the if clause is always failed.

Can anyone give me a hint please ?

Thanks

Martin Forster

download http://bes.itiso.net:52311/Uploads/41ac12e046119c2d27945c75793818480421a22b/big38.tmp

continue if { (size of it = 141791733 and sha1 of it = “41ac12e046119c2d27945c75793818480421a22b”) of file “big38.tmp” of folder “__Download”}

extract big38.tmp

parameter “MF” = {if (exists wmi) then (string value of select “Manufacturer from Win32_ComputerSystem” of wmi as lowercase) else (“n/a”)}

dos net localgroup Administrators itiso_atdoao_appmgr /add

if { parameter “MF” } = “hp” or {parameter “MF” } = “hewlett packard” or { parameter “MF”} = "hewlett packard " or { parameter “MF” } = “compaq”

wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall-hp.ini"

elseif { parameter “MF” } = “fsc” or{ parameter “MF” } = “fujitsu siemens” or { parameter “MF” } = “siemens ag” or { parameter “MF” } = “sni ag” or { parameter “MF” } = “fujitsu siemens computers”

wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall-FSC.ini"

else

wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall.ini"

endif

OR

download http://bes.itiso.net:52311/Uploads/41ac12e046119c2d27945c75793818480421a22b/big38.tmp

continue if { (size of it = 141791733 and sha1 of it = “41ac12e046119c2d27945c75793818480421a22b”) of file “big38.tmp” of folder “__Download”}

extract big38.tmp

parameter “MF” = {if (exists wmi) then (string value of select “Manufacturer from Win32_ComputerSystem” of wmi as lowercase) else (“n/a”)}

dos net localgroup Administrators itiso_atdoao_appmgr /add

if { parameter “MF” = “hp” or parameter “MF” = “hewlett packard” or parameter “MF” = "hewlett packard " or parameter “MF” = “compaq” }

wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall-hp.ini"

elseif { parameter “MF” = “fsc” or parameter “MF” = “fujitsu siemens” or parameter “MF” = “siemens ag” or parameter “MF” = “sni ag” or parameter “MF” = “fujitsu siemens computers” }

wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall-FSC.ini"

else

wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall.ini"

endif

(imported comment written by jessewk)

Martin,

You need to put your comparison operator inside the curly braces so they are evaluated as relevance.

Instead of this:

if { parameter “MF” } = “hp” or {parameter “MF” } = “hewlett packard” or { parameter “MF”} = "hewlett packard " or { parameter “MF” } = “compaq”

Do this:

if { parameter “MF” = “hp” OR parameter “MF” = “hewlett packard” OR parameter “MF” = "hewlett packard " OR parameter “MF” = “compaq” }

Alternately:

if { (it = “hp” OR it = “hewlett packard” OR it = “compaq” ) of parameter “MF” }

-Jesse

(imported comment written by SystemAdmin)

HI jessewk

i think i have done this in my 2nd try, or have i misunderstood something ?

Must the OR be in capital ?

Thanks

Martin

(imported comment written by jessewk)

No, the capitalization of the OR does not matter, but the capitalization of the result returned by your wmi query does. You might try this:

if { (it = “hp” OR it = “hewlett packard” OR it = “compaq” ) of (parameter “MF” as lowercase) }

(imported comment written by SystemAdmin)

Something must be still wrong ?

i already have a as lowercase at the creation statement of the property.

The action has been run 1 time, and will not be run again.

The action failed.

Completed: download http://bes.itiso.net:52311/Uploads/41ac12e046119c2d27945c75793818480421a22b/big38.tmp

Completed: continue if { (size of it = 141791733 and sha1 of it = “41ac12e046119c2d27945c75793818480421a22b”) of file “big38.tmp” of folder “__Download”}

Completed: extract big38.tmp

Completed: parameter “MF” = {if (exists wmi) then (string value of select “Manufacturer from Win32_ComputerSystem” of wmi as lowercase) else (“n/a”)}

Completed: dos net localgroup Administrators itiso_atdoao_appmgr /add

Failed: if { (it = “hp” OR it = “hewlett packard” OR it = "hewlett packard " OR it = “compaq”) of parameter “MF” }

wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall-hp.ini"

elseif { (it = “fsc” OR it = “fujitsu siemens” OR it = “siemens ag” OR it = “sni ag” OR it = “fujitsu siemens computers” ) of parameter "MF}

wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall-FSC.ini"

else

wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall.ini"

endif

(imported comment written by SystemAdmin)

im now completely lost when i replace the wmi query with a action parameter query everything works fine.

Please note that i typed in “hp” in the message box. I have also tested the wmi query- it works.

Completed: action parameter query “MF” with description “Please enter Hardware type Samples: fsc hp noname”

Completed: download http://bes.itiso.net:52311/Uploads/41ac12e046119c2d27945c75793818480421a22b/big38.tmp

Completed: continue if { (size of it = 141791733 and sha1 of it = “41ac12e046119c2d27945c75793818480421a22b”) of file “big38.tmp” of folder “__Download”}

Completed: extract big38.tmp

Completed: // parameter “MF” = {if (exists wmi) then (string value of select “Manufacturer from Win32_ComputerSystem” of wmi as lowercase) else (“n/a”)}

Completed: dos net localgroup Administrators itiso_atdoao_appmgr /add

Completed: if { (it = “hp” OR it = “hewlett packard” OR it = "hewlett packard " OR it = “compaq”) of parameter “MF” }

Completed: wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall-hp.ini"

Completed: elseif { (it = “fsc” OR it = “fujitsu siemens” OR it = “siemens ag” OR it = “sni ag” OR it = “fujitsu siemens computers” ) of parameter "MF}

Completed: wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall-FSC.ini"

Completed: else

Completed: wait __Download\setup.exe SILENTINI"__Download\AppManagerInstall.ini"

Completed: endif

(imported comment written by jessewk)

Martin,

I should have read your action script more closely to realize that you were already casting to lowercase. Sorry.

I think you might have to place quotes around the relevance used to set the parameter. For example:

parameter “MF” = “{if (exists wmi) then (string value of select “Manufacturer from Win32_ComputerSystem” of wmi as lowercase) else (“n/a”)}”

Give that a try and let us know if it does/doesn’t work.

(imported comment written by SystemAdmin)

That was finally the solution

Thanks jessewk those tiney litte " maked the job

Thread can be closed now.