File: sailcut.nsi.in

package info (click to toggle)
sailcut 1.2.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,580 kB
  • ctags: 875
  • sloc: cpp: 10,139; sh: 8,767; makefile: 176
file content (90 lines) | stat: -rw-r--r-- 2,761 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
79
80
81
82
83
84
85
86
87
88
89
90
;Sailcut CAD Installer

!define PRODUCT_NAME "Sailcut CAD"
!define PRODUCT_VERSION "@VERSION@"
!define PRODUCT_DIR_REGKEY "Software\Sailcut CAD"

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\sailcut-${PRODUCT_VERSION}-win32.exe"

SetCompressor lzma

InstallDir "$PROGRAMFILES\Sailcut CAD"
InstallDirRegKey HKCU "${PRODUCT_DIR_REGKEY}" ""

!include "MUI.nsh"
!define MUI_ABORTWARNING

!insertmacro MUI_PAGE_LICENSE "COPYING"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\sailcut.exe"
!define MUI_FINISHPAGE_LINK "Visit the Sailcut CAD website"
!define MUI_FINISHPAGE_LINK_LOCATION "http://sailcut.sourceforge.net/"
!insertmacro MUI_PAGE_FINISH
  
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
  
!insertmacro MUI_LANGUAGE "English"

Section "Sailcut CAD" SecSailcut
  SectionIn RO

  SetOutPath "$INSTDIR"
  WriteRegStr HKCU "${PRODUCT_DIR_REGKEY}" "" $INSTDIR

  File sailcut.exe
  File *.dll
  File ChangeLog
  File COPYING
  File README
  File /r data
  File /r icons

  WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd

Section "Documentation" SecHandbook
  File /r doc
SectionEnd

Section "Start Menu Shortcuts" SecShortcut
  CreateDirectory "$SMPROGRAMS\Sailcut CAD"
  CreateShortCut "$SMPROGRAMS\Sailcut CAD\Sailcut CAD.lnk" "$INSTDIR\sailcut.exe" "" "$INSTDIR\icons\sailcut.ico"
  CreateShortCut "$SMPROGRAMS\Sailcut CAD\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SectionEnd

Section "Register File Types" SecFileType
  WriteRegStr HKCR "SailcutCAD.SailDef" "" "Sailcut CAD Sail definition"
  WriteRegStr HKCR "SailcutCAD.SailDef\shell\open\command" "" '"$INSTDIR\sailcut.exe" "%1"'
  WriteRegStr HKCR "SailcutCAD.SailDef\DefaultIcon" "" "$INSTDIR\icons\sailcut-file.ico"
  WriteRegStr HKCR ".saildef" "" "SailcutCAD.SailDef"
SectionEnd

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${SecSailcut} "Installs Sailcut CAD."
  !insertmacro MUI_DESCRIPTION_TEXT ${SecHandbook} "Installs the Sailcut CAD HandBook."
  !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcut} "Adds icons to your start menu for easy access."
  !insertmacro MUI_DESCRIPTION_TEXT ${SecFileType} "Register Sailcut CAD file types."
!insertmacro MUI_FUNCTION_DESCRIPTION_END

Section "Uninstall"
  DeleteRegKey HKCR "SailcutCAD.SailDef"
  DeleteRegKey HKCR ".saildef"
  DeleteRegKey HKCU "${PRODUCT_DIR_REGKEY}"

  RMDir /r "$SMPROGRAMS\Sailcut CAD"

  Delete "$INSTDIR\sailcut.exe"
  Delete "$INSTDIR\*.dll"
  Delete "$INSTDIR\ChangeLog"
  Delete "$INSTDIR\COPYING"
  Delete "$INSTDIR\README"
  RMDir /r "$INSTDIR\data"
  RMDir /r "$INSTDIR\icons"
  RMDir /r "$INSTDIR\doc"
  Delete "$INSTDIR\uninstall.exe"
  RMDir "$INSTDIR"
SectionEnd