Add preInstall method and only commit when needed, remove repeating isRunning