3 ;; Installer script file for PCB for windows. See http://nsis.sourceforge.net
4 ;; for details on NSIS.
9 ;NSIS Modern User Interface
10 ;Start Menu Folder Selection Example Script
11 ;Written by Joost Verburg
13 ; and modified for wcalc by Dan McMahill
15 ; Later copied for use by PCB by Dan McMahill
17 ;--------------------------------
23 ;--------------------------------
24 ;Include macros for associating file
26 !include "registerExtension.nsh"
32 Name "PCB-@pcb_version@"
33 OutFile "pcbinst-@pcb_version@.exe"
36 ;See http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista
38 RequestExecutionLevel admin
40 ;Default installation folder
41 InstallDir "$PROGRAMFILES\PCB-@pcb_version@"
43 ;Get installation folder from registry if available
44 InstallDirRegKey HKCU "Software\pcb-@pcb_version@" ""
46 ;--------------------------------
52 ;--------------------------------
55 !define MUI_ABORTWARNING
57 ;--------------------------------
60 !insertmacro MUI_PAGE_LICENSE
"@pcb_srcdir@\COPYING"
61 !insertmacro MUI_PAGE_LICENSE
"@gd_win32_runtime@\gd-license.txt"
62 !insertmacro MUI_PAGE_LICENSE
"@gtk_win32_runtime@\LICENSE-gpl2"
63 !insertmacro MUI_PAGE_LICENSE
"@gtk_win32_runtime@\LICENSE-gpl3"
64 !insertmacro MUI_PAGE_LICENSE
"@gtk_win32_runtime@\LICENSE-lgpl"
65 !insertmacro MUI_PAGE_LICENSE
"@gtk_win32_runtime@\LICENSE-expat"
66 !insertmacro MUI_PAGE_LICENSE
"@gtk_win32_runtime@\LICENSE-fontconfig"
67 !insertmacro MUI_PAGE_LICENSE
"@gtk_win32_runtime@\LICENSE-jpeg"
68 !insertmacro MUI_PAGE_LICENSE
"@gtk_win32_runtime@\LICENSE-png"
69 !insertmacro MUI_PAGE_LICENSE
"@gtk_win32_runtime@\LICENSE-tiff"
70 !insertmacro MUI_PAGE_LICENSE
"@gtk_win32_runtime@\LICENSE-zlib"
71 ; !insertmacro MUI_PAGE_COMPONENTS
72 !insertmacro MUI_PAGE_DIRECTORY
74 ;Start Menu Folder Page Configuration
75 !define MUI_STARTMENUPAGE_REGISTRY_ROOT
"HKCU"
76 !define MUI_STARTMENUPAGE_REGISTRY_KEY
"Software\PCB-@pcb_version@"
77 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME
"Start Menu Folder"
79 !insertmacro MUI_PAGE_STARTMENU Application
$STARTMENU_FOLDER
81 !insertmacro MUI_PAGE_INSTFILES
83 !insertmacro MUI_UNPAGE_CONFIRM
84 !insertmacro MUI_UNPAGE_INSTFILES
86 ;--------------------------------
89 !insertmacro MUI_LANGUAGE
"English"
91 ;--------------------------------
94 Section "Dummy Section" SecDummy
97 SetShellVarContext all
100 ;ADD YOUR OWN FILES HERE...
101 File /a
/r
"@gtk_win32_runtime@\*.*"
102 File /a
/r
"@gd_win32_runtime@\*.*"
103 File /a
/r
"@pcb_prefix@\*.*"
105 ;Associate file types and icons
106 ${registerExtension} "$INSTDIR\bin\pcb.exe" "" ".pcb" "PCB Layout File"
107 ${registerExtension} "$INSTDIR\bin\pcb.exe" "" ".fp" "PCB Footprint File"
110 ;Store installation folder
111 WriteRegStr HKCU "Software\pcb-@pcb_version@" "" $INSTDIR
114 WriteUninstaller "$INSTDIR\Uninstall.exe"
116 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
119 CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
120 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
121 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\HTML Manual.lnk" "$INSTDIR\doc\html\pcb.html"
122 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\PDF Manual.lnk" "$INSTDIR\doc\pdf\pcb.pdf"
123 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Readme.lnk" "$INSTDIR\doc\Readme.txt"
125 SetShellVarContext current
126 SetOutPath "$DOCUMENTS"
127 SetShellVarContext all
129 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\PCB.lnk" "$INSTDIR\bin\pcb.exe" "" "$INSTDIR\bin\pcb.exe" 0 "" "" "PCB Printed Circuit Board Layout Editor"
130 SetOutPath "$INSTDIR"
132 ;; CreateShortCut link.lnk target.file [parameters [icon.file [icon_index_number [start_options [keyboard_shortcut [description]]]]]]
134 !insertmacro MUI_STARTMENU_WRITE_END
138 ;--------------------------------
142 ; LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
144 ;Assign language strings to sections
145 ; !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
146 ; !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
147 ; !insertmacro MUI_FUNCTION_DESCRIPTION_END
149 ;--------------------------------
153 SetShellVarContext all
155 ;ADD YOUR OWN FILES HERE...
157 ${unregisterExtension} ".pcb" "PCB Layout File"
158 ${unregisterExtension} ".fp" "PCB Footprint File"
160 Delete "$INSTDIR\Uninstall.exe"
161 Delete "$INSTDIR\*.*"
163 RMDir /r
"$INSTDIR\*.*"
166 !insertmacro MUI_STARTMENU_GETFOLDER Application
$MUI_TEMP
168 Delete "$SMPROGRAMS\$MUI_TEMP\HTML Manual.lnk"
169 Delete "$SMPROGRAMS\$MUI_TEMP\PCB.lnk"
170 Delete "$SMPROGRAMS\$MUI_TEMP\PDF Manual.lnk"
171 Delete "$SMPROGRAMS\$MUI_TEMP\Readme.lnk"
172 Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
174 ;Delete empty start menu parent diretories
175 StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
180 GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
182 IfErrors startMenuDeleteLoopDone
184 StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
185 startMenuDeleteLoopDone:
187 DeleteRegKey /ifempty
HKCU "Software\pcb-@pcb_version@"