Skip to content

Commit fad946a

Browse files
committed
Improvements to the nsi template.
1 parent f844541 commit fad946a

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

syrup/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def compileNSISTemplate(build_dir, artifact_dir, executables, **kwargs):
266266
'files': install_files,
267267
'dirs': install_dirs,
268268
'outfile': os.path.join(artifact_dir, "${APPNAME}-${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}-setup.exe"),
269-
'size': install_size,
269+
'size': install_size / 1024,
270270
'executables': install_executables,
271271
}
272272
template_variables.update(kwargs)

syrup/templates/generic.nsi.j2

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
# All the other settings can be tweaked by editing the !defines at the top of this script
1010
!define APPNAME "{{ name }}"
1111
!define COMPANYNAME "{{ company }}"
12+
{% if description is defined and description %}
1213
!define DESCRIPTION "{{ description }}"
14+
{% else %}
15+
!define DESCRIPTION ""
16+
{% endif %}
1317
# These three must be integers
1418
!define VERSIONMAJOR {{ version.major }}
1519
!define VERSIONMINOR {{ version.minor }}
@@ -99,26 +103,30 @@ section "install"
99103
{% endfor %}
100104

101105
# Registry information for add/remove programs
102-
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" "${COMPANYNAME} - ${APPNAME} - ${DESCRIPTION}"
106+
{% if description is defined and description %}
107+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" "${APPNAME} - ${DESCRIPTION}"
108+
{% else %}
109+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" "${APPNAME}"
110+
{% endif %}
103111
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
104112
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
105-
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" "$\"$INSTDIR$\""
113+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" "$INSTDIR"
106114
{% if icon is defined and icon %}
107-
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$\"$INSTDIR\{{ icon }}$\""
115+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$INSTDIR\{{ icon }}"
108116
{% else %}
109-
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$\"$INSTDIR\{{ executables | first }}$\""
117+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$INSTDIR\{{ executables | first }}"
110118
{% endif %}
111-
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "Publisher" "$\"${COMPANYNAME}$\""
119+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "Publisher" "${COMPANYNAME}"
112120
{% if help_url is defined and help_url %}
113-
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "HelpLink" "$\"${HELPURL}$\""
121+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "HelpLink" "${HELPURL}"
114122
{% endif %}
115123
{% if update_url is defined and update_url %}
116-
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\""
124+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLUpdateInfo" "${UPDATEURL}"
117125
{% endif %}
118126
{% if website_url is defined and website_url %}
119-
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLInfoAbout" "$\"${ABOUTURL}$\""
127+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLInfoAbout" "${ABOUTURL}"
120128
{% endif %}
121-
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\""
129+
WriteRegStr "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}"
122130
WriteRegDWORD "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMajor" ${VERSIONMAJOR}
123131
WriteRegDWORD "${REG}" "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMinor" ${VERSIONMINOR}
124132
# There is no option for modifying or repairing the install

0 commit comments

Comments
 (0)