File: TS_installer.nsi

package info (click to toggle)
treesheets 1:1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,952 kB
  • sloc: cpp: 31,134; makefile: 66; ansic: 9
file content (111 lines) | stat: -rw-r--r-- 2,852 bytes parent folder | download | duplicates (3)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

!include "MUI.nsh"
!define MUI_FINISHPAGE_RUN "$INSTDIR\TreeSheets.exe"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "TreeSheets\tsinst.bmp"
/*
doesn't show?
!define MUI_HEADERIMAGE_UNBITMAP "TreeSheets\tsinst.bmp"
*/

Name "TreeSheets"

OutFile "Treesheets_Setup.exe"

XPStyle on

InstallDir $PROGRAMFILES\TreeSheets

InstallDirRegKey HKLM "Software\TreeSheets" "Install_Dir"

SetCompressor /SOLID lzma
XPStyle on

Page components #"" ba ""
Page directory 
Page instfiles 
!insertmacro MUI_PAGE_FINISH

UninstPage uninstConfirm 
UninstPage instfiles 

!insertmacro MUI_LANGUAGE "English"

/*
AddBrandingImage top 65

Function ba
	File TreeSheets\dot3.bmp
  SetBrandingImage TreeSheets\dot3.bmp
FunctionEnd

Function un.ba
  SetBrandingImage TreeSheets\dot3.bmp
FunctionEnd
*/

Function .onInit
  FindWindow $0 "TreeSheets" ""
  StrCmp $0 0 continueInstall
    MessageBox MB_ICONSTOP|MB_OK "TreeSheets is already running, please close it and try again."
    Abort
  continueInstall:
FunctionEnd

Function un.onInit
  FindWindow $0 "TreeSheets" ""
  StrCmp $0 0 continueInstall
    MessageBox MB_ICONSTOP|MB_OK "TreeSheets is still running, please close it and try again."
    Abort
  continueInstall:
FunctionEnd

Section "TreeSheets (required)"

  SectionIn RO
  
  SetOutPath $INSTDIR
  
  File /r "TS\*.*"
  
  WriteRegStr HKLM SOFTWARE\TreeSheets "Install_Dir" "$INSTDIR"
  
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TreeSheets" "DisplayName" "TreeSheets"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TreeSheets" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TreeSheets" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TreeSheets" "NoRepair" 1
  WriteUninstaller "uninstall.exe"
  
SectionEnd

/*
Section "Visual C++ redistributable runtime"

  ExecWait '"$INSTDIR\redist\vcredist_x86.exe"'
  
SectionEnd
*/

Section "Start Menu Shortcuts"

  CreateDirectory "$SMPROGRAMS\TreeSheets"
  CreateDirectory "$APPDATA\TreeSheetsdbs\"
  
  SetOutPath "$INSTDIR"
  
  CreateShortCut "$SMPROGRAMS\TreeSheets\TreeSheets.lnk"    "$INSTDIR\TreeSheets.exe"  "" "$INSTDIR\TreeSheets.exe"  0
  CreateShortCut "$SMPROGRAMS\TreeSheets\Uninstall.lnk"     "$INSTDIR\uninstall.exe"   "" "$INSTDIR\uninstall.exe"   0
  CreateShortCut "$SMPROGRAMS\TreeSheets\Documentation.lnk" "$INSTDIR\readme.html"     "" "$INSTDIR\readme.html"     0
  CreateShortCut "$SMPROGRAMS\TreeSheets\Examples.lnk"      "$INSTDIR\Examples\"       "" "$INSTDIR\Examples\"       0
  
SectionEnd

Section "Uninstall"
  
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TreeSheets"
  DeleteRegKey HKLM SOFTWARE\TreeSheets

  RMDir /r "$SMPROGRAMS\TreeSheets"
  RMDir /r "$INSTDIR"

SectionEnd