language improvements
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4363 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
833b9ab873
commit
2888715ca3
2 changed files with 39 additions and 39 deletions
|
@ -56,7 +56,7 @@ You can escape quotes using $\\:
|
||||||
|
|
||||||
\c MessageBox MB_OK "I'll be happy" ; this one puts a ' inside a string
|
\c MessageBox MB_OK "I'll be happy" ; this one puts a ' inside a string
|
||||||
\c MessageBox MB_OK 'And he said to me "Hi there!"' ; this one puts a " inside a string
|
\c MessageBox MB_OK 'And he said to me "Hi there!"' ; this one puts a " inside a string
|
||||||
\c MessageBox MB_OK `And he said to me "I'll be fucked!"` ; this one puts both ' and "s inside a string
|
\c MessageBox MB_OK `And he said to me "I'll be happy!"` ; this one puts both ' and "s inside a string
|
||||||
\c MessageBox MB_OK "$\"A quote from a wise man$\" said the wise man" ; this one shows escaping of quotes
|
\c MessageBox MB_OK "$\"A quote from a wise man$\" said the wise man" ; this one shows escaping of quotes
|
||||||
|
|
||||||
It is also possible to put newlines, tabs etc. in a string using $\\r, $\\n, $\\t etc. \R{varstrings}{More information...}
|
It is also possible to put newlines, tabs etc. in a string using $\\r, $\\n, $\\t etc. \R{varstrings}{More information...}
|
||||||
|
|
|
@ -27,8 +27,8 @@ BGGradient 000000 800000 FFFFFF
|
||||||
InstallColors FF8080 000030
|
InstallColors FF8080 000030
|
||||||
XPStyle on
|
XPStyle on
|
||||||
|
|
||||||
InstallDir "$PROGRAMFILES\NSISCrap\BigNSISTest"
|
InstallDir "$PROGRAMFILES\NSISTest\BigNSISTest"
|
||||||
InstallDirRegKey HKLM "Software\NSISCrap\BigNSISTest" ""
|
InstallDirRegKey HKLM "Software\NSISTest\BigNSISTest" ""
|
||||||
|
|
||||||
CheckBitmap "${NSISDIR}\Contrib\Graphics\Checks\classic-cross.bmp"
|
CheckBitmap "${NSISDIR}\Contrib\Graphics\Checks\classic-cross.bmp"
|
||||||
|
|
||||||
|
@ -63,10 +63,10 @@ ShowInstDetails show
|
||||||
|
|
||||||
Section "" ; empty string makes it hidden, so would starting with -
|
Section "" ; empty string makes it hidden, so would starting with -
|
||||||
|
|
||||||
; write reg crap
|
; write reg info
|
||||||
StrCpy $1 "POOOOOOOOOOOP"
|
StrCpy $1 "POOOOOOOOOOOP"
|
||||||
DetailPrint "I like to f*ck sheep $1"
|
DetailPrint "I like to be able to see what is going on (debug) $1"
|
||||||
WriteRegStr HKLM SOFTWARE\NSISCrap\BigNSISTest "Install_Dir" "$INSTDIR"
|
WriteRegStr HKLM SOFTWARE\NSISTest\BigNSISTest "Install_Dir" "$INSTDIR"
|
||||||
|
|
||||||
; write uninstall strings
|
; write uninstall strings
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "DisplayName" "BigNSISTest (remove only)"
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "DisplayName" "BigNSISTest (remove only)"
|
||||||
|
@ -74,7 +74,7 @@ Section "" ; empty string makes it hidden, so would starting with -
|
||||||
|
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
File /a "silent.nsi"
|
File /a "silent.nsi"
|
||||||
CreateDirectory "$INSTDIR\shiz\crap" ; 2 recursively create a directory for fun.
|
CreateDirectory "$INSTDIR\MyProjectFamily\MyProject" ; 2 recursively create a directory for fun.
|
||||||
WriteUninstaller "bt-uninst.exe"
|
WriteUninstaller "bt-uninst.exe"
|
||||||
|
|
||||||
Nop ; for fun
|
Nop ; for fun
|
||||||
|
@ -86,13 +86,13 @@ Section "TempTest"
|
||||||
SectionIn 1 2 3
|
SectionIn 1 2 3
|
||||||
Start: MessageBox MB_OK "Start:"
|
Start: MessageBox MB_OK "Start:"
|
||||||
|
|
||||||
MessageBox MB_YESNO "Goto Poop" IDYES Poop
|
MessageBox MB_YESNO "Goto MyLabel" IDYES MyLabel
|
||||||
|
|
||||||
MessageBox MB_OK "Right before Poop:"
|
MessageBox MB_OK "Right before MyLabel:"
|
||||||
|
|
||||||
Poop: MessageBox MB_OK "Poop:"
|
MyLabel: MessageBox MB_OK "MyLabel:"
|
||||||
|
|
||||||
MessageBox MB_OK "Right after Poop:"
|
MessageBox MB_OK "Right after MyLabel:"
|
||||||
|
|
||||||
MessageBox MB_YESNO "Goto Start:?" IDYES Start
|
MessageBox MB_YESNO "Goto Start:?" IDYES Start
|
||||||
|
|
||||||
|
@ -104,34 +104,34 @@ Section "Test Registry/INI functions"
|
||||||
|
|
||||||
SectionIn 1 4 3
|
SectionIn 1 4 3
|
||||||
|
|
||||||
WriteRegStr HKLM SOFTWARE\NSISCrap\BigNSISTest "StrTest_INSTDIR" "$INSTDIR"
|
WriteRegStr HKLM SOFTWARE\NSISTest\BigNSISTest "StrTest_INSTDIR" "$INSTDIR"
|
||||||
WriteRegDword HKLM SOFTWARE\NSISCrap\BigNSISTest "DwordTest_0xDEADBEEF" 0xdeadbeef
|
WriteRegDword HKLM SOFTWARE\NSISTest\BigNSISTest "DwordTest_0xDEADBEEF" 0xdeadbeef
|
||||||
WriteRegDword HKLM SOFTWARE\NSISCrap\BigNSISTest "DwordTest_123456" 123456
|
WriteRegDword HKLM SOFTWARE\NSISTest\BigNSISTest "DwordTest_123456" 123456
|
||||||
WriteRegDword HKLM SOFTWARE\NSISCrap\BigNSISTest "DwordTest_0123" 0123
|
WriteRegDword HKLM SOFTWARE\NSISTest\BigNSISTest "DwordTest_0123" 0123
|
||||||
WriteRegBin HKLM SOFTWARE\NSISCrap\BigNSISTest "BinTest_deadbeef01f00dbeef" "DEADBEEF01F00DBEEF"
|
WriteRegBin HKLM SOFTWARE\NSISTest\BigNSISTest "BinTest_deadbeef01f00dbeef" "DEADBEEF01F00DBEEF"
|
||||||
StrCpy $8 "$SYSDIR\Poop"
|
StrCpy $8 "$SYSDIR\IniTest"
|
||||||
WriteINIStr "$INSTDIR\test.ini" "MySection" "Value1" $8
|
WriteINIStr "$INSTDIR\test.ini" "MySection" "Value1" $8
|
||||||
WriteINIStr "$INSTDIR\test.ini" "MySectionShit" "Value1" $8
|
WriteINIStr "$INSTDIR\test.ini" "MySectionIni" "Value1" $8
|
||||||
WriteINIStr "$INSTDIR\test.ini" "MySectionShit" "Value2" $8
|
WriteINIStr "$INSTDIR\test.ini" "MySectionIni" "Value2" $8
|
||||||
WriteINIStr "$INSTDIR\test.ini" "POOPon" "Value1" $8
|
WriteINIStr "$INSTDIR\test.ini" "IniOn" "Value1" $8
|
||||||
|
|
||||||
Call poopTest
|
Call MyFunctionTest
|
||||||
|
|
||||||
DeleteINIStr "$INSTDIR\test.ini" "POOPon" "Value1"
|
DeleteINIStr "$INSTDIR\test.ini" "IniOn" "Value1"
|
||||||
DeleteINISec "$INSTDIR\test.ini" "MySectionShit"
|
DeleteINISec "$INSTDIR\test.ini" "MySectionIni"
|
||||||
|
|
||||||
ReadINIStr $1 "$INSTDIR\test.ini" "MySectionShit" "Value1"
|
ReadINIStr $1 "$INSTDIR\test.ini" "MySectionIni" "Value1"
|
||||||
StrCmp $1 "" INIDelSuccess
|
StrCmp $1 "" INIDelSuccess
|
||||||
MessageBox MB_OK "DeleteINISec failed"
|
MessageBox MB_OK "DeleteINISec failed"
|
||||||
INIDelSuccess:
|
INIDelSuccess:
|
||||||
|
|
||||||
ClearErrors
|
ClearErrors
|
||||||
ReadRegStr $1 HKCR "software\microsoft" shit
|
ReadRegStr $1 HKCR "software\microsoft" xyz_¢¢_does_not_exist
|
||||||
IfErrors 0 NoError
|
IfErrors 0 NoError
|
||||||
MessageBox MB_OK "could not read from HKCR\software\microsoft\shit"
|
MessageBox MB_OK "could not read from HKCR\software\microsoft\xyz_¢¢_does_not_exist"
|
||||||
Goto ErrorYay
|
Goto ErrorYay
|
||||||
NoError:
|
NoError:
|
||||||
MessageBox MB_OK "read '$1' from HKCR\software\microsoft\shit"
|
MessageBox MB_OK "read '$1' from HKCR\software\microsoft\xyz_¢¢_does_not_exist"
|
||||||
ErrorYay:
|
ErrorYay:
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
@ -180,11 +180,11 @@ Section "Test Branching"
|
||||||
|
|
||||||
StrCpy $1 "x"
|
StrCpy $1 "x"
|
||||||
|
|
||||||
LoopPoop:
|
LoopTest:
|
||||||
|
|
||||||
Call myfunc
|
Call myfunc
|
||||||
StrCpy $1 "x$1"
|
StrCpy $1 "x$1"
|
||||||
StrCmp $1 "xxxxxx" 0 LoopPoop
|
StrCmp $1 "xxxxxx" 0 LoopTest
|
||||||
|
|
||||||
NoRecurse:
|
NoRecurse:
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ SectionEnd
|
||||||
|
|
||||||
SectionGroupEnd
|
SectionGroupEnd
|
||||||
|
|
||||||
Section "Test Exec functions" CRAPIDX
|
Section "Test Exec functions" TESTIDX
|
||||||
|
|
||||||
SectionIn 1 2 3
|
SectionIn 1 2 3
|
||||||
|
|
||||||
|
@ -245,14 +245,14 @@ FunctionEnd
|
||||||
|
|
||||||
Function myfunc
|
Function myfunc
|
||||||
|
|
||||||
StrCpy $2 "poop=$1"
|
StrCpy $2 "MyTestVar=$1"
|
||||||
MessageBox MB_OK "myfunc: $2"
|
MessageBox MB_OK "myfunc: $2"
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function poopTest
|
Function MyFunctionTest
|
||||||
|
|
||||||
ReadINIStr $1 "$INSTDIR\test.ini" "MySectionShit" "Value1"
|
ReadINIStr $1 "$INSTDIR\test.ini" "MySectionIni" "Value1"
|
||||||
StrCmp $1 $8 NoFailedMsg
|
StrCmp $1 $8 NoFailedMsg
|
||||||
MessageBox MB_OK "WriteINIStr failed"
|
MessageBox MB_OK "WriteINIStr failed"
|
||||||
|
|
||||||
|
@ -262,12 +262,12 @@ FunctionEnd
|
||||||
|
|
||||||
Function .onSelChange
|
Function .onSelChange
|
||||||
|
|
||||||
SectionGetText ${CRAPIDX} $0
|
SectionGetText ${TESTIDX} $0
|
||||||
StrCmp $0 "" e
|
StrCmp $0 "" e
|
||||||
SectionSetText ${CRAPIDX} ""
|
SectionSetText ${TESTIDX} ""
|
||||||
Goto e2
|
Goto e2
|
||||||
e:
|
e:
|
||||||
SectionSetText ${CRAPIDX} "Doop"
|
SectionSetText ${TESTIDX} "TextInSection"
|
||||||
e2:
|
e2:
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -282,7 +282,7 @@ UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-uninstall.ico"
|
||||||
Section "Uninstall"
|
Section "Uninstall"
|
||||||
|
|
||||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest"
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest"
|
||||||
DeleteRegKey HKLM "SOFTWARE\NSISCrap\BigNSISTest"
|
DeleteRegKey HKLM "SOFTWARE\NSISTest\BigNSISTest"
|
||||||
Delete "$INSTDIR\silent.nsi"
|
Delete "$INSTDIR\silent.nsi"
|
||||||
Delete "$INSTDIR\LogicLib.nsi"
|
Delete "$INSTDIR\LogicLib.nsi"
|
||||||
Delete "$INSTDIR\bt-uninst.exe"
|
Delete "$INSTDIR\bt-uninst.exe"
|
||||||
|
@ -295,8 +295,8 @@ Section "Uninstall"
|
||||||
RMDir "$INSTDIR\cpdest" ; skipped if no
|
RMDir "$INSTDIR\cpdest" ; skipped if no
|
||||||
NoDelete:
|
NoDelete:
|
||||||
|
|
||||||
RMDir "$INSTDIR\shiz\crap"
|
RMDir "$INSTDIR\MyProjectFamily\MyProject"
|
||||||
RMDir "$INSTDIR\shiz"
|
RMDir "$INSTDIR\MyProjectFamily"
|
||||||
RMDir "$INSTDIR"
|
RMDir "$INSTDIR"
|
||||||
|
|
||||||
IfFileExists "$INSTDIR" 0 NoErrorMsg
|
IfFileExists "$INSTDIR" 0 NoErrorMsg
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue