File: AppGen.nsi

package info (click to toggle)
nsis 3.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,496 kB
  • sloc: cpp: 39,326; ansic: 27,284; python: 1,386; asm: 712; xml: 409; pascal: 231; makefile: 225; javascript: 67
file content (78 lines) | stat: -rwxr-xr-x 2,047 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
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
Name "${NAME}"
!define /IfNDef OUTFILE ""
OutFile "${OUTFILE}"
Unicode True
!define /IfNDef REL User
RequestExecutionLevel ${REL}
XPStyle On
ManifestDPIAware True
AutoCloseWindow True
BrandingText " "
Caption "$(^Name) (${ARCBITS}-bit)"
MiscButtonText " " " " "E&xit" " "
LicenseBkColor /windows

!ifdef COMPANY
!ifndef NOPEVI
!define /IfNDef VER 1.2.3.4
VIProductVersion ${VER}
VIAddVersionKey /LANG=0 "FileVersion" "${VER}"
VIAddVersionKey /LANG=0 "CompanyName" "${COMPANY}"
VIAddVersionKey /LANG=0 "LegalCopyright" "${U+00A9} ${COMPANY}"
VIAddVersionKey /LANG=0 "FileDescription" "${NAME}"
!endif
!endif

!include WinMessages.nsh
!include LogicLib.nsh

PageEx License
	Caption " "
	LicenseText "$ExeFile$\n$ExePath" "E&xit"
	PageCallbacks "" OnShow
PageExEnd
Page InstFiles


Function .onInit
!ifdef AUMI
System::Call 'SHELL32::SetCurrentProcessExplicitAppUserModelID(ws)' "${AUMI}"
!endif
FunctionEnd


Function OnShow
FindWindow $0 "#32770" "" $hWndParent
GetDlgItem $R9 $0 0x3E8

!ifdef MSG
SendMessage $R9 ${EM_REPLACESEL} "" "STR:${MSG}$\r$\n$\r$\n"
!endif

!ifdef TMPLDATA
${IfNot} ${FileExists} "$AppData\${NAME}\*"
  ; Copy template data from the shared source to this users profile
  CreateDirectory "$AppData\${NAME}"
  CopyFiles /Silent "${TMPLDATA}\*" "$AppData\${NAME}"
${EndIf}
ReadIniStr $2 "$AppData\${NAME}\Data.ini" Example Count
IntOp $2 $2 + 1
WriteIniStr "$AppData\${NAME}\Data.ini" Example Count $2
SendMessage $R9 ${EM_REPLACESEL} "" "STR:Launch Count=$2$\r$\n$\r$\n"
!endif

SendMessage $R9 ${EM_REPLACESEL} "" "STR:CmdLine=$CmdLine$\r$\n"
ReadEnvStr $2 "USERNAME"
SendMessage $R9 ${EM_REPLACESEL} "" "STR:%USERNAME%=$2$\r$\n"
ReadEnvStr $2 "__COMPAT_LAYER"
StrCmp $2 "" +2
SendMessage $R9 ${EM_REPLACESEL} "" "STR:Compatibility=$2$\r$\n"
FunctionEnd

Section
SectionEnd