Change setupState to only run after an actual "install" event

Change setupState function to take a details object, and then only do the initial setup if it's an actual installation event.

This fixes issue #38