Squirrel.Windows icon indicating copy to clipboard operation
Squirrel.Windows copied to clipboard

How to create a shortcut that adds extra arguments to the executed app?

Open lipis opened this issue 9 years ago • 6 comments

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?

lipis avatar Nov 09 '15 13:11 lipis

I was wondering the very same thing.

Janneman84 avatar Nov 11 '15 20:11 Janneman84

@paulcbetts any input on this one?

lipis avatar Dec 01 '15 10:12 lipis

Use --process-start-args option. Like this:

Update.exe --createShortcut=App.exe --shortcut-locations=Startup --process-start-args "foo bar"

matteobaglini avatar Dec 17 '15 15:12 matteobaglini

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"

grandtiger avatar Sep 07 '16 14:09 grandtiger

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="&quot;[#{{Id}}.exe]&quot; --checkInstall --process-start-args &quot;[STARTARGS]&quot;" /> 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.

ken-sands avatar Oct 23 '21 20:10 ken-sands

@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

BestOfTheBestSir avatar Feb 01 '24 17:02 BestOfTheBestSir