You are here

NSIS Script launcher & Open with

3 posts / 0 new
Last post
SimonGeek
Offline
Last seen: 6 months 1 week ago
Joined: 2022-07-24 01:22
NSIS Script launcher & Open with

Hi, I'm trying to create an NSIS compiled executable that selecting it from the "open with" choices opens the designated file in a specific executable. Basically a sort of launcher similar to the PA.c launcher but without including any code belonging to it. I noticed that the PA.c Template has "FileTypeCommandLine" and "FileTypeCommandLine-extension", is it possible to implement such a thing in a .nsi script?

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

Among the software available on PortableApps you can take "AIMP Portable" as an example.

A few days ago I asked the same thing but without explaining in detail and I have not received a conclusive answer. I asked in the NSIS forum and they didn't reply there either.

richo
richo's picture
Offline
Last seen: 1 month 1 week ago
Joined: 2007-01-31 22:03
Sample code for get the filename passed via Open With

Here's some sample code that can be used as a base for getting the filename that is passed to the NSIS compiled script:

; Includes the header that provides the GetParameters macro
!include FileFunc.nsh
!insertmacro GetParameters

; Creates a variable for the passed in File
Var sFilePath

Section "Main"

	; Get File passed in
	${GetParameters} $sFilePath

	; Execute software with passed in File
	Exec '"$EXEDIR\RelativePathToSoftware" $sFilePath'

SectionEnd

Modify to suit your existing code.

SimonGeek
Offline
Last seen: 6 months 1 week ago
Joined: 2022-07-24 01:22
Thank you very much

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

In fact, I too thought that this could be done through FileFunc.nsh but I didn't know how exactly .

Log in or register to post comments