You are here

How do I make a Launcher for multiple exes?

10 posts / 0 new
Last post
Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
How do I make a Launcher for multiple exes?

I have some programs I use on a regular basis so I want a launcher to launch them with one click.
I already did that with NSIS but I don't always want to run all the programs. So I thought maybe there is a way to have NSIS display a list with checkboxes and the Appname next to it and it runs all the Apps you click the checkbox.
Or something like that.
I couldnt figure it out myself cause my NSIS skills aren't that good Sad
Does anyone has any hints???

Any help/ideas/thoughts is appreciated!!!

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 2 months ago
Joined: 2006-01-06 21:27
Hint: nsDialogs

Checkout nsDialogs (it's the InstallOptions plugin successor) and the examples of that. It should show how to get all the options.

"If you're not part of the solution, you're part of the precipitate."

Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Thanks Ryan

Ill try that.
EDIT
I have been playing with it for some time but it doesn't seem to work Sad

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 2 months ago
Joined: 2006-01-06 21:27
How so?

What do you mean "it doesn't work"?

"If you're not part of the solution, you're part of the precipitate."

Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
I had some

problems but it works now except for the part at the end where I want it to execute several exes if a variable is "true".
I'll post it:

OutFile "Launcher.exe"
;SilentInstall silent
RequestExecutionLevel user
Icon "\Documents\nsi\PAPPS.ico"
!include nsDialogs.nsh
!include LogicLib.nsh


Page custom nsDialogsPage
Page instfiles
;=== Variables
Var CHECKBOXFF
Var CHECKBOXTB
Var CHECKBOXPC
Var CHECKBOXCW
Var CW
Var FF
Var TB
Var PC

Function nsDialogsPage
	nsDialogs::Create /NOUNLOAD 1018
	Pop $0
	${NSD_CreateCheckbox} 0 10 100% 8u Firefox
	Pop $CHECKBOXFF
	GetFunctionAddress $0 OnCheckboxFF
	nsDialogs::OnClick /NOUNLOAD $CHECKBOXFF $0
	${NSD_CreateCheckbox} 0 70 100% 8u ClamWin
	Pop $CHECKBOXCW
	GetFunctionAddress $1 OnCheckboxCW
	nsDialogs::OnClick /NOUNLOAD $CHECKBOXCW $1
	${NSD_CreateCheckbox} 0 30 100% 8u Thunderbird
	Pop $CHECKBOXTB
	GetFunctionAddress $2 OnCheckboxTB
	nsDialogs::OnClick /NOUNLOAD $CHECKBOXTB $2
	${NSD_CreateCheckbox} 0 50 100% 8u Popcorn
	Pop $CHECKBOXPC
	GetFunctionAddress $3 OnCheckboxPC
	nsDialogs::OnClick /NOUNLOAD $CHECKBOXPC $3
	nsDialogs::Show
FunctionEnd
Function OnCheckboxFF
SendMessage $CHECKBOXFF ${BM_GETSTATE} 0 0 $0
${If} $0 != 0
  StrCpy $FF "true"
  ;SetAutoClose true
${EndIf}
FunctionEnd

Function OnCheckboxCW
SendMessage $CHECKBOXCW ${BM_GETSTATE} 0 0 $1
${If} $1 != 0
  StrCpy $CW "true"
  ;SetAutoClose true
${EndIf}
FunctionEnd

Function OnCheckboxTB
SendMessage $CHECKBOXTB ${BM_GETSTATE} 0 0 $2
${If} $2 != 0
  StrCpy $TB "true"
  ;SetAutoClose true
${EndIf}
FunctionEnd

Function OnCheckboxPC
SendMessage $CHECKBOXPC ${BM_GETSTATE} 0 0 $3
${If} $3 != 0
  StrCpy $PC "true"
  ;SetAutoClose true
${EndIf}
FunctionEnd

 Function .onInstSuccess
${If} $FF = "true"
	Exec Firefox.exe
${ElseIf} $CW = "true"
	Exec Clamwin.exe
${ElseIf} $PC = "true"
	Exec Popcorn.exe
${ElseIf} $TB = "true"
	Exec Thunderbird.exe
${EndIf}
  FunctionEnd
Section
SectionEnd

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 2 months ago
Joined: 2006-01-06 21:27
Why LogicLib?

Why use LogicLib functions? StrCmp and Goto would also work. i.e.

StrCmp $FF "true" "" CheckClamwin
ExecWait "$EXEDIR\firefox.exe"
Goto End
; etc...

Also, make sure you use absolute paths to anything you execute.

"If you're not part of the solution, you're part of the precipitate."

Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Thanks

I know about the paths - I have shortcuts to the Apps in the root of my drive. Smile
Works like a charm now!

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 11 years 2 months ago
Developer
Joined: 2005-12-10 15:22
Why,

LogicLib, because goto's make the code downright unreadable IMHO.

Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Well

For some things I use LogicLib and StrCmp for others.
It may be not the best way but it works Smile

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 2 months ago
Joined: 2006-01-06 21:27
Yes, but

They are natively supported. If I can remember correctly, LogicLib uses it internally anyway. If you don't use LogicLib, you can see any errors you've made straight away.

"If you're not part of the solution, you're part of the precipitate."

Log in or register to post comments