Old 26th July 2022, 01:43   #1
Simbonino
Junior Member
 
Join Date: Jul 2022
Posts: 4
Question Pass parameters to a certain exe with NSIS

Hi, I would like to create a script to compile with NSIS that works via "open with".

Suppose we have a .txt file, on the txt file I right-click, "open with" and select the executable compiled with NSIS. Subsequently the same executable will transfer the opening of the file to specific software.

Is it possible to insert a string of code that does what I wrote inside an nsi script?

Basically I was planning to create a Launcher to be able to make software portable without relying on third party software similar to PortableApps.com Launcher or WinPenPack's X-Launcher.

Other features I managed to implement but unfortunately "open with" does not work.
Simbonino is offline   Reply With Quote
Old 27th July 2022, 19:01   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,538
What does "unfortunately "open with" does not work." mean?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 27th July 2022, 20:18   #3
Simbonino
Junior Member
 
Join Date: Jul 2022
Posts: 4
I explain better

EXAMPLE:

1) I have an audio file in .aac format, I click on it with the right mouse button
2) Using "Open with" I select the executable created with NSIS
3) The executable created with NSIS will open the .aac file in a software present in the same folder as the compiled script.

Obviously always if this is theoretically possible.
Simbonino is offline   Reply With Quote
Old 27th July 2022, 20:27   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,538
Open with is not special in this case, the file is a command line parameter.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 27th July 2022, 21:03   #5
Simbonino
Junior Member
 
Join Date: Jul 2022
Posts: 4
Thank you

Thank you very much! I've been looking for a solution for at least a week.

If I may ask, where do I find the string to enter as a command line?
Simbonino is offline   Reply With Quote
Old 29th July 2022, 13:52   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,538
${GetParameters} $0. Check you question on Stackoverflow for the full code.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 30th July 2022, 02:57   #7
Simbonino
Junior Member
 
Join Date: Jul 2022
Posts: 4
Thank you

Thank you very much
Simbonino is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump