Kaseya Community

Script Runs but skips the IF - Start to Success Then

This question is answered

Hi folks,


This is going to be a silly (Rusty) procedure writer issue but it is wrecking my head...


I have a script to deploy Adobe Reader but when I run it - it runs the write procedure log line and then just goes to "Success Then" (completed)


Can anybody tell me what I am doing wrong - Note: the Double Quotes on the path in the IF were only added as a last resort.

Thanks


Verified Answer
  • You need to make the Install variable a global variable and then it will work.

All Replies
  • You have 4 writeprocedurelogentry steps, which one is it writing?

    -Max

  • Sorry, disregard my previous message, I see you are setting the "install" variable to true on line 11. So that's what really doesn't make sense. The install variable is being set in 11 to true then you're testing it in line 12 to equal true. That means that step 12 should always run if you get to the else clause. I still think what you want is to move the last if clause on line 12 outside the else and have it run independently.

    -Max

  • Hi Max, I actually had it outside originally but it does not seem to be running the first IF at all... It runs Step 1 then just finishes...

  • add a writeprocedurelog step immediately after the first if check (line 3) and see if it's written. That will confirm if it's getting into the If.

  • My assumption is that it's running the first "if" check, goes into the else (line 7) and then finishes.

  • This is back to the way I had it... and the output..

  • Looks like you are missing the #'s on the Install variable in you checkVar If Step


    Here are the install switch I use for my Adobe Reader install script

    /sALL /rs /msi ALLUSERS=1 EULA_ACCEPT=YES REMOVE_PREVIOUS=YES DISABLE_ARM_SERVICE_INSTALL=1 REBOOT=ReallySuppress /qn

    These switches will block auto updating via the ARM service, accept the EULA, remove the previous install of Adobe Reader and prevent the computer from rebooting after the install is complete.


    Also this script won't work on a 64bit Windows machine

  • Hi I altered the #install# and it did run but it is failing now on line 12, It looks like the #install# is not being populated so it looks like it is completely skipping the first main IF.

    IF exists then Else Install = true  (seems to skipping this part)

    IF install = true then run

  • I know about the 64bit they do not have any 64bit machines (corporate policy)

  • You need to make the Install variable a global variable and then it will work.

  • Yeah HardKnoX is right on the money there. Remember the scoping rules. It is very similar to how C++ works, that the variable is only scoped within the area it is created in in most cases. For your variable name use global:INSTALL and then when you call it, call it from #global:INSTALL# and it should then read it correctly.

  • Thanks folks.... seems to be working now...