2020-09-05 19:29:53 +02:00
|
|
|
!include "MUI2.nsh"
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
; The name of the installer
|
|
|
|
Name "LeoCAD"
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
; The file to write
|
|
|
|
OutFile "leocad-setup.exe"
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
; Request application privileges for Windows Vista
|
|
|
|
;RequestExecutionLevel admin
|
|
|
|
|
|
|
|
; Build Unicode installer
|
|
|
|
Unicode True
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
; The default installation directory
|
|
|
|
InstallDir $PROGRAMFILES64\LeoCAD
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
; Registry key to check for directory (so if you install again, it will
|
|
|
|
; overwrite the old one automatically)
|
|
|
|
InstallDirRegKey HKLM "Software\LeoCAD Software\LeoCAD" "InstallFolder"
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
; Icon "setup.ico"
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
; !define MUI_ICON "setup.ico"
|
|
|
|
; !define MUI_UNICON "setup.ico"
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
SetCompressor /SOLID lzma
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2012-03-21 02:54:03 +01:00
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
;Interface Settings
|
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
!define MUI_HEADERIMAGE
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
;Pages
|
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
!define MUI_FINISHPAGE_RUN "$INSTDIR\LeoCAD.exe"
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
!insertmacro MUI_UNPAGE_WELCOME
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
!insertmacro MUI_UNPAGE_FINISH
|
2011-09-07 23:06:51 +02:00
|
|
|
|
2020-09-05 19:29:53 +02:00
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
;Installer Sections
|
|
|
|
|
|
|
|
Section "LeoCAD" SecLeoCAD
|
|
|
|
|
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
|
2019-03-14 21:13:55 +01:00
|
|
|
File /r "appdir\*"
|
2012-04-11 06:58:40 +02:00
|
|
|
|
2012-04-06 01:50:09 +02:00
|
|
|
;Register file extension
|
|
|
|
WriteRegStr HKCR ".lcd" "" "LeoCAD.Project"
|
|
|
|
WriteRegStr HKCR ".lcd\ShellNew" "NullFile" ""
|
|
|
|
WriteRegStr HKCR "LeoCAD.Project" "" "LeoCAD Project"
|
|
|
|
WriteRegStr HKCR "LeoCAD.Project\DefaultIcon" "" "$INSTDIR\LeoCAD.exe,0"
|
|
|
|
WriteRegStr HKCR "LeoCAD.Project\shell" "" "open"
|
|
|
|
WriteRegStr HKCR "LeoCAD.Project\shell\open\command" "" '"$INSTDIR\LeoCAD.exe" "%1"'
|
|
|
|
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
2019-06-17 08:07:40 +02:00
|
|
|
|
|
|
|
IfFileExists "$INSTDIR\vc_redist.x64.exe" VcRedist64Exists PastVcRedist64Check
|
|
|
|
VcRedist64Exists:
|
|
|
|
ExecWait '"$INSTDIR\vc_redist.x64.exe" /quiet /norestart'
|
|
|
|
PastVcRedist64Check:
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
;Store installation folder
|
2020-09-05 19:29:53 +02:00
|
|
|
;WriteRegStr HKLM "Software\LeoCAD Software\LeoCAD" "InstallFolder" $INSTDIR
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
CreateShortCut "$SMPROGRAMS\LeoCAD.lnk" "$INSTDIR\LeoCAD.exe"
|
|
|
|
|
|
|
|
;Create uninstaller
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD" "DisplayName" "LeoCAD"
|
2020-09-05 19:29:53 +02:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD" "Publisher" "LeoCAD.org"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD" "DisplayIcon" '"$INSTDIR\LeoCAD.exe"'
|
2011-09-07 23:06:51 +02:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD" "URLUpdateInfo" "http://www.leocad.org"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD" "URLInfoAbout" "http://www.leocad.org"
|
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD" "NoModify" 1
|
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD" "NoRepair" 1
|
2020-09-05 19:29:53 +02:00
|
|
|
|
|
|
|
!include "FileFunc.nsh"
|
|
|
|
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
|
|
|
IntFmt $0 "0x%08X" $0
|
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD" "EstimatedSize" "$0"
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Uninstaller Section
|
|
|
|
|
|
|
|
Section "Uninstall"
|
|
|
|
|
|
|
|
Delete "$SMPROGRAMS\LeoCAD.lnk"
|
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
|
|
|
|
|
|
Delete "$INSTDIR\LeoCAD.exe"
|
|
|
|
Delete "$INSTDIR\LeoCAD.hlp"
|
|
|
|
Delete "$INSTDIR\LeoCAD.cnt"
|
|
|
|
Delete "$INSTDIR\readme.txt"
|
2012-12-13 23:40:01 +01:00
|
|
|
Delete "$INSTDIR\library.bin"
|
2018-01-16 03:07:48 +01:00
|
|
|
Delete "$INSTDIR\povconsole32-sse2.exe"
|
2019-06-17 08:07:40 +02:00
|
|
|
Delete "$INSTDIR\vc_redist.x64.exe"
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
RMDir "$INSTDIR"
|
|
|
|
|
2012-04-06 01:50:09 +02:00
|
|
|
DeleteRegKey HKCR ".lcd"
|
|
|
|
DeleteRegKey HKCR "LeoCAD.Project"
|
|
|
|
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
|
|
|
|
2011-09-07 23:06:51 +02:00
|
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LeoCAD"
|
2020-09-05 19:29:53 +02:00
|
|
|
DeleteRegKey HKLM "Software\LeoCAD Software\LeoCAD\InstallFolder"
|
|
|
|
DeleteRegKey /ifempty HKCU "Software\LeoCAD Software\LeoCAD"
|
2011-09-07 23:06:51 +02:00
|
|
|
|
|
|
|
SectionEnd
|