Squirrel.Windows
Squirrel.Windows copied to clipboard
How to create a shortcut that adds extra arguments to the executed app?
Usually when the app is added to the Startup menu it should be minimised or hidden. In order to add the shortcut into the Startup I'm doing something like this and it works as advertised:
Update.exe --createShortcut=App.exe --shortcut-locations=Startup
How could I add an extra argument like for example --startup
, so the App.exe
would start with that argument?
I was wondering the very same thing.
@paulcbetts any input on this one?
Use --process-start-args
option. Like this:
Update.exe --createShortcut=App.exe --shortcut-locations=Startup --process-start-args "foo bar"
Is it possible to create multiple shortcuts for different environments? such as:
Update.exe --createShortcut=App.exe --shortcut-locations=Startup --process-start-args "dev"
Update.exe --createShortcut=App.exe --shortcut-locations=Startup --process-start-args "uat"
Update.exe --createShortcut=App.exe --shortcut-locations=Startup --process-start-args "prod"
Doing the same thing for an msi install requires tweaking the wxs template but is also workable (and considering the wider rollout idea behind the msi probably even more useful)
Something like
<RegistryValue Type="expandable" Name="{{Id}}Deployment" Value=""[#{{Id}}.exe]" --checkInstall --process-start-args "[STARTARGS]"" />
Then call the msi with setup.msi STARTARGS="extra args"
You'd probably want to work in the changes in #296 too, Takes some wrangling to get things fit for proper enterprise type rollout without needing rollout scripts to add stuff post install, a lot of baked in assumptions making this very much aimed at same install for all from a single url type thing but it can be done.
@matteobaglini Is there option to add the same to the installation process? https://github.com/Squirrel/Squirrel.Windows/blob/master/src/Update/Program.cs#L106
The goal is to have a way to create & use setup.config
file which will be read by application on installation or first run