|
|
#1 |
|
Major Dude
Join Date: Jan 2006
Location: /\/¯¯¯¯¯\/\ , South-Africa
Posts: 1,026
|
Adding one parameter to installer
I'm having problems reading parameters in nsis.
I only need a number in the parameter. The number will then replace this number in my curent code. Hope this isn't do difficult to do .Thanks in advance. CURRENT CODE ... SendMessage $0 ${WM_COMMAND} 40012 0 ... The number in bold will then be replaced with the parameter. EX: C:\myInstaller.exe 40012 will then do the same as my current code. I've included my source code. ClassicPro© v2.01 : This plugin allows you to use cPro skins in Winamp. ClassicPro skins are all SUI skins and loads very quickly. ClassicPro skins is even easier to skin than Winamp Classic skins. A new layout have been added since version 2. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Use GetParameters which you can find in the NSIS documentation under Useful Scripts.
-Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Major Dude
Join Date: Jan 2006
Location: /\/¯¯¯¯¯\/\ , South-Africa
Posts: 1,026
|
Thanks for the help so far but I still need help getting it working. Here is the source:
!include WinMessages.nsh Name "Alarm" Caption "Alarm Notice" OutFile "zzzz.exe" Icon "..\Contrib\Graphics\Icons\llama-grey.ico" silent by default. ; SilentInstall silent Function CloseProgram Exch $1 Push $0 FindWindow $0 $1 SendMessage $0 ${WM_COMMAND} 40012 0 Pop $0 Pop $1 FunctionEnd Function .onInit Push "Winamp v1.x" Call CloseProgram SetSilent silent FunctionEnd Function GetParameters Push $R0 Push $R1 Push $R2 Push $R3 StrCpy $R2 1 StrLen $R3 $CMDLINE ;Check for quote or space StrCpy $R0 $CMDLINE $R2 StrCmp $R0 '"' 0 +3 StrCpy $R1 '"' Goto loop StrCpy $R1 " " loop: IntOp $R2 $R2 + 1 StrCpy $R0 $CMDLINE 1 $R2 StrCmp $R0 $R1 get StrCmp $R2 $R3 get Goto loop get: IntOp $R2 $R2 + 1 StrCpy $R0 $CMDLINE 1 $R2 StrCmp $R0 " " get StrCpy $R0 $CMDLINE "" $R2 Pop $R3 Pop $R2 Pop $R1 Exch $R0 FunctionEnd Section SectionEnd ..:: How do I get the int in the parameter to the 40012. I will run the setup like this: "C:\zzzz.exe 40012" If the code look funny its because I don't know much about nsis. Can you maybe correct the above code? Hope you can help me a a
ClassicPro© v2.01 : This plugin allows you to use cPro skins in Winamp. ClassicPro skins are all SUI skins and loads very quickly. ClassicPro skins is even easier to skin than Winamp Classic skins. A new layout have been added since version 2. |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
code: -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#5 |
|
Major Dude
Join Date: Jan 2006
Location: /\/¯¯¯¯¯\/\ , South-Africa
Posts: 1,026
|
Thanks!!!!!!
I still can believe it's working! Finaly! Thanks again, Afrow UK ClassicPro© v2.01 : This plugin allows you to use cPro skins in Winamp. ClassicPro skins are all SUI skins and loads very quickly. ClassicPro skins is even easier to skin than Winamp Classic skins. A new layout have been added since version 2. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|