I'll a note for followup.  If the package isn't installed it'll default to a high number and from every run after the first it'll be fine and more reliable than what I'm doing currently.