leocad/tools/setup/leocad.nsi

124 lines
3.8 KiB
Text
Raw Normal View History

2011-09-07 23:06:51 +02:00
;LeoCAD Setup Script
;Written by Leonardo Zide (based on one of the example scripts)
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;General
;Name and file
Name "LeoCAD"
OutFile "LeoCAD-setup.exe"
;Default installation folder
InstallDir "$PROGRAMFILES\LeoCAD"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\BT Software\LeoCAD" "InstallPath"
Icon "setup.ico"
!define MUI_ICON "setup.ico"
!define MUI_UNICON "setup.ico"
SetCompressor /SOLID lzma
2011-09-07 23:06:51 +02:00
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "LeoCAD" SecLeoCAD
SetOutPath "$INSTDIR"
File "LeoCAD.exe"
2013-08-14 06:31:39 +02:00
;File "LeoCAD.hlp"
;File "LeoCAD.cnt"
File "..\..\docs\ReadMe.txt"
File "..\..\library.bin"
2018-01-16 03:07:48 +01:00
File "..\povray\povconsole32-sse2.exe"
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"'
;WriteRegStr HKCR "LeoCAD.Project\shell" "" "print"
;WriteRegStr HKCR "LeoCAD.Project\shell\print\command" "" '"$INSTDIR\LeoCAD.exe" /p "%1"'
;WriteRegStr HKCR "LeoCAD.Project\shell" "" "printto"
;WriteRegStr HKCR "LeoCAD.Project\shell\printto\command" "" '"$INSTDIR\LeoCAD.exe" /pt "%1" "%2" "%3" "%4"'
2012-04-06 01:50:09 +02:00
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
2012-04-11 06:58:40 +02:00
2011-09-07 23:06:51 +02:00
;Store installation folder
2013-08-14 06:31:39 +02:00
;WriteRegStr HKCU "Software\BT Software\LeoCAD" "InstallPath" $INSTDIR
2011-09-07 23:06:51 +02:00
; Overwrite old Pieces Library path.
;WriteRegStr HKCU "Software\BT Software\LeoCAD\Settings" "PiecesLibrary" $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"
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
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"
Delete "$INSTDIR\library.bin"
2018-01-16 03:07:48 +01:00
Delete "$INSTDIR\povconsole32-sse2.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"
DeleteRegKey HKCU "Software\BT Software\LeoCAD\InstallPath"
DeleteRegKey /ifempty HKCU "Software\BT Software\LeoCAD"
SectionEnd