git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7282 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2021-07-24 21:32:37 +00:00
parent 4d0fa5e3f5
commit 58283f34d9

View file

@ -1,78 +1,78 @@
/* /*
Note: This is not a installer example script, it's a script for a simple application used by some of the other examples. Note: This is not a installer example script, it's a script for a simple application used by some of the other examples.
*/ */
!define /math ARCBITS ${NSIS_PTR_SIZE} * 8 !define /math ARCBITS ${NSIS_PTR_SIZE} * 8
Name "${NAME}" Name "${NAME}"
!define /IfNDef OUTFILE "" !define /IfNDef OUTFILE ""
OutFile "${OUTFILE}" OutFile "${OUTFILE}"
Unicode True Unicode True
!define /IfNDef REL User !define /IfNDef REL User
RequestExecutionLevel ${REL} RequestExecutionLevel ${REL}
XPStyle On XPStyle On
ManifestDPIAware True ManifestDPIAware True
AutoCloseWindow True AutoCloseWindow True
BrandingText " " BrandingText " "
Caption "$(^Name) (${ARCBITS}-bit)" Caption "$(^Name) (${ARCBITS}-bit)"
MiscButtonText " " " " "E&xit" " " MiscButtonText " " " " "E&xit" " "
LicenseBkColor /windows LicenseBkColor /windows
!ifdef COMPANY !ifdef COMPANY
!ifndef NOPEVI !ifndef NOPEVI
!define /IfNDef VER 1.2.3.4 !define /IfNDef VER 1.2.3.4
VIProductVersion ${VER} VIProductVersion ${VER}
VIAddVersionKey /LANG=0 "FileVersion" "${VER}" VIAddVersionKey /LANG=0 "FileVersion" "${VER}"
VIAddVersionKey /LANG=0 "CompanyName" "${COMPANY}" VIAddVersionKey /LANG=0 "CompanyName" "${COMPANY}"
VIAddVersionKey /LANG=0 "LegalCopyright" "${U+00A9} ${COMPANY}" VIAddVersionKey /LANG=0 "LegalCopyright" "${U+00A9} ${COMPANY}"
VIAddVersionKey /LANG=0 "FileDescription" "${NAME}" VIAddVersionKey /LANG=0 "FileDescription" "${NAME}"
!endif !endif
!endif !endif
!include WinMessages.nsh !include WinMessages.nsh
!include LogicLib.nsh !include LogicLib.nsh
PageEx License PageEx License
Caption " " Caption " "
LicenseText "$ExeFile$\n$ExePath" "E&xit" LicenseText "$ExeFile$\n$ExePath" "E&xit"
PageCallbacks "" OnShow PageCallbacks "" OnShow
PageExEnd PageExEnd
Page InstFiles Page InstFiles
Function .onInit Function .onInit
!ifdef AUMI !ifdef AUMI
System::Call 'SHELL32::SetCurrentProcessExplicitAppUserModelID(ws)' "${AUMI}" System::Call 'SHELL32::SetCurrentProcessExplicitAppUserModelID(ws)' "${AUMI}"
!endif !endif
FunctionEnd FunctionEnd
Function OnShow Function OnShow
FindWindow $0 "#32770" "" $hWndParent FindWindow $0 "#32770" "" $hWndParent
GetDlgItem $R9 $0 0x3E8 GetDlgItem $R9 $0 0x3E8
!ifdef MSG !ifdef MSG
SendMessage $R9 ${EM_REPLACESEL} "" "STR:${MSG}$\r$\n$\r$\n" SendMessage $R9 ${EM_REPLACESEL} "" "STR:${MSG}$\r$\n$\r$\n"
!endif !endif
!ifdef TMPLDATA !ifdef TMPLDATA
${IfNot} ${FileExists} "$AppData\${NAME}\*" ${IfNot} ${FileExists} "$AppData\${NAME}\*"
; Copy template data from the shared source to this users profile ; Copy template data from the shared source to this users profile
CreateDirectory "$AppData\${NAME}" CreateDirectory "$AppData\${NAME}"
CopyFiles /Silent "${TMPLDATA}\*" "$AppData\${NAME}" CopyFiles /Silent "${TMPLDATA}\*" "$AppData\${NAME}"
${EndIf} ${EndIf}
ReadIniStr $2 "$AppData\${NAME}\Data.ini" Example Count ReadIniStr $2 "$AppData\${NAME}\Data.ini" Example Count
IntOp $2 $2 + 1 IntOp $2 $2 + 1
WriteIniStr "$AppData\${NAME}\Data.ini" Example Count $2 WriteIniStr "$AppData\${NAME}\Data.ini" Example Count $2
SendMessage $R9 ${EM_REPLACESEL} "" "STR:Launch Count=$2$\r$\n$\r$\n" SendMessage $R9 ${EM_REPLACESEL} "" "STR:Launch Count=$2$\r$\n$\r$\n"
!endif !endif
SendMessage $R9 ${EM_REPLACESEL} "" "STR:CmdLine=$CmdLine$\r$\n" SendMessage $R9 ${EM_REPLACESEL} "" "STR:CmdLine=$CmdLine$\r$\n"
ReadEnvStr $2 "USERNAME" ReadEnvStr $2 "USERNAME"
SendMessage $R9 ${EM_REPLACESEL} "" "STR:%USERNAME%=$2$\r$\n" SendMessage $R9 ${EM_REPLACESEL} "" "STR:%USERNAME%=$2$\r$\n"
ReadEnvStr $2 "__COMPAT_LAYER" ReadEnvStr $2 "__COMPAT_LAYER"
StrCmp $2 "" +2 StrCmp $2 "" +2
SendMessage $R9 ${EM_REPLACESEL} "" "STR:Compatibility=$2$\r$\n" SendMessage $R9 ${EM_REPLACESEL} "" "STR:Compatibility=$2$\r$\n"
FunctionEnd FunctionEnd
Section Section
SectionEnd SectionEnd