Write a script that installs a package file automatically with limited interaction from user I'm trying to run a package installer from terminal and have it complete with limited interaction from the user. This will need to be ran on any computer.

The bash script I have so far is:

sudo installer -store -pkg "/Users/username/Desktop/test.pkg" -target /


It will not complete and I am getting the following error:
installer: Can't load package "/Users/username/Desktop/test.pkg": The requested URL was not found on this server.

Not sure what this error means as I'm a newbie to scripting. Please advise what is needed to fix this.
It is not possible to run any command using sudo without user interaction because the user will have to supply an administrative password.