Page 1 of 1

Update Packs - Initializing Update

Posted: Fri Aug 20, 2010 2:10 pm
by gsaunders
If you have an initial install and you are going to allow manual updates / or via our application by calling setup.exe /update... I see in the documentation that I have to run setup.exe /updatesetup /s at least once and was recommended to do so at the comment "TO-DO: Insert command that starts your application here".

This comment is actually found under the following if thens...

Code: Select all

if Varialbe RUNAPP Equals TRUE
  if Variable REMOVE Equals FALSE
     if Variable SUCCESS Equals COMPLETE
        Comment: TO-DO: Insert command that starts your application here
     end
   end
end
It seems this should NOT be the place for this. I would think you would want this to run silently even if the user chose to not run the app, because this is needed according to the document to properly initialize before the user of setup.exe /update. If the user chose NOT to run the app then this command would not run and when they manually run the app later it will have never had the setup.exe /updatesetup /s succesfully run and could lead to the problems described in the document.

So... it seems to me this should be run in it's own if Variable SUCCESS Equals COMPLETE and then leave my normal run of the application in the section where the code checks the RUNAPP for true. See example below.

Code: Select all

if Variable SUCCESS Equals COMPLETE
   Run Program $EXENAME$ /updatesetup /s (WAIT)
end

if Varialbe RUNAPP Equals TRUE
  if Variable REMOVE Equals FALSE
     if Variable SUCCESS Equals COMPLETE
        Run Program $TARGETDIR$\ApplicationName.exe
     end
   end
end
Is this how I should do this? Or is there another more correct solution?

Re: Update Packs - Initializing Update

Posted: Fri Aug 20, 2010 8:52 pm
by mills
You may be right. Our scripts are just templates, but ideally they should embrace "best practices". I'll look into this first thing next week and get you a solid answer.

Re: Update Packs - Initializing Update

Posted: Wed Aug 25, 2010 8:54 am
by gsaunders
Just following up as I hadn't heard back on this one yet.

I changed it to this in this particular test:

Code: Select all

  if Variable SUCCESS Equals COMPLETE
    if Variable ALLUSERS Equals TRUE
      Run Program $UPDATEEXE_ALLUSERS$ /updatesetup
    end
    if Variable ALLUSERS Equals FALSE
      Run Program $UPDATEEXE_JUSTME$ /updatesetup
    end
  end
This way it runs the correct update.