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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
|
SetCompressor /SOLID lzma
; Script generated by the HM NIS Edit Script Wizard.
;!include PathMani.nsh
; HM NIS Edit Wizard helper defines
!define GNM_NAME "Gnumeric"
!define GNM_LONGNAME "Gnumeric Spreadsheet"
!define GNM_APPNAME "Gnumeric Spreadsheet"
!define GNM_VERSION "@VERSION@"
!define GNM_VERSION_TAG "@YYYYMMDD@"
!define GNM_VERSION_FULL "${GNM_VERSION}-${GNM_VERSION_TAG}"
!define GNM_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GNM_NAME}"
!define GNM_STARTMENU_REG_VAL "NSIS:StartMenuDir"
!define GNM_HELP_DIR "share\gnumeric\${GNM_VERSION}\doc\C"
!define GNM_HELP "${GNM_HELP_DIR}\gnumeric.chm"
!define GOFFICE_VERSION "@GOFFICE_VERSION@"
;!define GTK_VERSION "2.20"
;!define GTK_VENDORRC "0"
;!define GTK_VENDORVERSION "${GTK_VERSION}.${GTK_VENDORRC}"
; MUI 1.67 compatible ------
!include "MUI.nsh"
;ReserveFile "op1.ini"
;ReserveFile "op3.ini"
;!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
;!insertmacro MUI_RESERVEFILE_LANGDLL
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TEXT "You can always get the newest version from:\r\n\r\nhttp://www.gnumeric.org/\r\n\r\nThis wizard will guide you through the installation of $(^NameDA).\r\n\r\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer.\r\n\r\n$_CLICK"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "COPYING"
Page custom CustomPageShortcut
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Gnumeric"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_LINK "Visit the Gnumeric website for the latest news"
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.gnumeric.org/"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
InstType "Standard"
InstType "Minimal"
InstType "Full"
; MUI end ------
Var SHORTINSTDIR
Var ISADMIN
Var INI_VALUE
Name "${GNM_LONGNAME} ${GNM_VERSION_FULL}"
OutFile "gnumeric-${GNM_VERSION_FULL}.exe"
Icon "share\pixmaps\win32-gnumeric.ico"
InstallDir "$PROGRAMFILES\${GNM_NAME}"
InstallDirRegKey HKLM "Software\GNOME\${GNM_NAME}" "Path"
ShowInstDetails hide
ShowUnInstDetails show
!define GNM_ROOT "$INSTDIR\${GNM_VERSION}"
Section "Gnumeric (required)" SEC01
SectionIn 1 2 3 RO
SetOutPath "${GNM_ROOT}\bin"
File /x "libpython*.dll" "bin\*.dll"
File "bin\gnumeric.exe"
File "bin\ssconvert.exe"
File "bin\ssgrep.exe"
File "bin\gsf.exe"
File "bin\gsf-vba-dump.exe"
File "bin\gtk-update-icon-cache.exe"
File "bin\gdk-pixbuf-query-loaders.exe"
# required for g_spawn_*
File "bin\gspawn-win32-helper-console.exe"
File "bin\gspawn-win32-helper.exe"
# helpful smoke test
File "bin\gtk-demo.exe"
SetOutPath "${GNM_ROOT}"
File /r etc
File /r /x "*.a" /x "*.la" /x "*.lib" /x "*.def" /x "pkgconfig" /x "include" /x "Python25" lib
SetOutPath "${GNM_ROOT}\share"
File /r "share\themes"
File /r "share\goffice"
File /r /x C "share\gnumeric"
File /r "share\libthai"
;File /r "share\libgda-4.0"
;File /r "share\libgda-4.1"
;File /r /x "demo" "share\gnome-db-3.0"
File /r "share\pixmaps"
File /r "share\icons"
SetOutPath "${GNM_ROOT}\${GNM_HELP_DIR}"
File "${GNM_HELP}"
File "${GNM_HELP_DIR}\gnumeric.hhmap"
WriteRegStr SHCTX "Software\GNOME\${GNM_NAME}" "Path" "${GNM_ROOT}\bin"
WriteRegStr SHCTX "Software\GNOME\${GNM_NAME}" "Version" "${GNM_VERSION_FULL}"
GetFullPathName /SHORT $SHORTINSTDIR ${GNM_ROOT}
StrCmp $ISADMIN "1" 0 +5
ExecWait "regedit /s $SHORTINSTDIR\etc\win32\reg\gnumeric-dialogs.reg"
ExecWait "regedit /s $SHORTINSTDIR\etc\win32\reg\gnumeric-general.reg"
ExecWait "regedit /s $SHORTINSTDIR\etc\win32\reg\gnumeric-plugins.reg"
Goto +4
ExecWait "regedit /s $SHORTINSTDIR\etc\win32\reg\gnumeric-dialogs.hkcu.reg"
ExecWait "regedit /s $SHORTINSTDIR\etc\win32\reg\gnumeric-general.hkcu.reg"
ExecWait "regedit /s $SHORTINSTDIR\etc\win32\reg\gnumeric-plugins.hkcu.reg"
;ExecWait "${GNM_ROOT}\bin\gdk-pixbuf-query-loaders.exe >${GNM_ROOT}\etc\gtk-2.0\gdk-pixbuf.loaders"
;ExecWait "${GNM_ROOT}\gtk-update-icon-cache.exe ${GNM_ROOT}\share\icons\gnome"
;ExecWait "${GNM_ROOT}\gtk-update-icon-cache.exe ${GNM_ROOT}\share\icons\hicolor"
WriteRegStr HKCR "GNOME.Gnumeric" "" "Gnumeric Spreadsheet"
WriteRegStr HKCR "GNOME.Gnumeric\shell" "" "Open"
WriteRegStr HKCR "GNOME.Gnumeric\DefaultIcon" "" "${GNM_ROOT}\bin\gnumeric.exe,0"
WriteRegStr HKCR "GNOME.Gnumeric\shell\Open\command" "" '"${GNM_ROOT}\bin\gnumeric.exe" "%1"'
WriteRegStr HKCR "Applications\gnumeric.exe\shell\Open\command" "" '"${GNM_ROOT}\bin\gnumeric.exe" "%1"'
SectionEnd
#############################################################################
SectionGroup "File Handlers"
Section "Gnumeric (.gnumeric)"
SectionIn 1 2 3
WriteRegStr HKCR ".gnumeric" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".gnumeric" "Content Type" "application/x-gnumeric"
SectionEnd
Section "MS Excel (tm)"
SectionIn 3
WriteRegStr HKCR ".xls" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".xls" "Content Type" "application/vnd.ms-excel"
WriteRegStr HKCR ".xlw" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".xlw" "Content Type" "application/vnd.ms-excel"
WriteRegStr HKCR ".xlt" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".xlt" "Content Type" "application/vnd.ms-excel"
WriteRegStr HKCR ".xlsx" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".xlsx" "Content Type" "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
WriteRegStr HKCR ".xltx" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".xltx" "Content Type" "application/vnd.openxmlformats-officedocument.spreadsheetml.template"
SectionEnd
Section "OpenOffice.org ODF"
SectionIn 3
WriteRegStr HKCR ".ods" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".ods" "Content Type" "vnd.oasis.opendocument.spreadsheet"
WriteRegStr HKCR ".ots" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".ots" "Content Type" "vnd.oasis.opendocument.spreadsheet-template"
WriteRegStr HKCR ".sxc" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".sxc" "Content Type" "application/vnd.sun.xml.calc"
WriteRegStr HKCR ".stc" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".stc" "Content Type" "application/vnd.sun.xml.calc.template"
SectionEnd
Section "Lotus 123 (tm)"
SectionIn 3
WriteRegStr HKCR ".wk1" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".wk1" "Content Type" "application/vnd.lotus-1-2-3"
WriteRegStr HKCR ".wk4" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".wk4" "Content Type" "application/vnd.lotus-1-2-3"
WriteRegStr HKCR ".wr1" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".wr1" "Content Type" "application/vnd.lotus-1-2-3"
WriteRegStr HKCR ".wks" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".wks" "Content Type" "application/vnd.lotus-1-2-3"
WriteRegStr HKCR ".123" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".123" "Content Type" "application/vnd.lotus-1-2-3"
SectionEnd
Section "Applix (.as)"
SectionIn 1 3
WriteRegStr HKCR ".as" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".as" "Content Type" "application/x-applix-spreadsheet"
SectionEnd
Section "Quattro Pro (tm)"
SectionIn 1 3
WriteRegStr HKCR ".wb1" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".wb1" "Content Type" "application/x-quattro-pro"
WriteRegStr HKCR ".wb2" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".wb2" "Content Type" "application/x-quattro-pro"
WriteRegStr HKCR ".wb3" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".wb3" "Content Type" "application/x-quattro-pro"
SectionEnd
Section "Plan Perfect (tm)"
SectionIn 1 3
WriteRegStr HKCR ".pln" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".pln" "Content Type" "application/x-planperfect"
SectionEnd
Section "Psiconv"
SectionIn 1 3
WriteRegStr HKCR ".psisheet" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".psisheet" "Content Type" "application/x-psiconv"
SectionEnd
Section "Data Interchange Format (.dif)"
SectionIn 1 3
WriteRegStr HKCR ".dif" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".dif" "Content Type" "application/x-dif-spreadsheet"
SectionEnd
Section "Multiplan SYLK"
SectionIn 1 3
WriteRegStr HKCR ".slk" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".slk" "Content Type" "application/x-sylk"
WriteRegStr HKCR ".sylk" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".sylk" "Content Type" "application/x-sylk"
SectionEnd
Section "GNU Oleo"
SectionIn 1 3
WriteRegStr HKCR ".oleo" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".oleo" "Content Type" "application/x-oleo"
SectionEnd
Section "Paradox Database (tm)"
SectionIn 1 3
WriteRegStr HKCR ".px" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".px" "Content Type" "application/x-paradox-db"
SectionEnd
Section "XBase Database (tm)"
SectionIn 1 3
WriteRegStr HKCR ".dbf" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".dbf" "Content Type" "application/dbf"
SectionEnd
Section "MPS linear and integer programs"
SectionIn 1 3
WriteRegStr HKCR ".mps" "" "GNOME.Gnumeric"
WriteRegStr HKCR ".mps" "Content Type" "application/x-mps"
SectionEnd
SectionGroupEnd
#############################################################################
!macro Locale LOCALE
Section "${LOCALE} Translation"
SectionIn 1 3
SetOutPath "${GNM_ROOT}\share\locale\${LOCALE}\LC_MESSAGES"
File "share\locale\${LOCALE}\LC_MESSAGES\gtk20.mo"
File "share\locale\${LOCALE}\LC_MESSAGES\glib20.mo"
File "share\locale\${LOCALE}\LC_MESSAGES\goffice-${GOFFICE_VERSION}.mo"
File "share\locale\${LOCALE}\LC_MESSAGES\gnumeric.mo"
File "share\locale\${LOCALE}\LC_MESSAGES\gnumeric-functions.mo"
SectionEnd
!macroend
SectionGroup "Translations"
!insertmacro Locale "am"
!insertmacro Locale "ar"
!insertmacro Locale "az"
!insertmacro Locale "bg"
!insertmacro Locale "ca"
!insertmacro Locale "cs"
!insertmacro Locale "da"
!insertmacro Locale "de"
!insertmacro Locale "el"
!insertmacro Locale "en_CA"
!insertmacro Locale "en_GB"
!insertmacro Locale "es"
!insertmacro Locale "et"
!insertmacro Locale "fi"
!insertmacro Locale "fr"
!insertmacro Locale "ga"
!insertmacro Locale "gl"
!insertmacro Locale "he"
!insertmacro Locale "hr"
!insertmacro Locale "hu"
!insertmacro Locale "it"
!insertmacro Locale "ja"
!insertmacro Locale "ko"
!insertmacro Locale "lt"
!insertmacro Locale "lv"
!insertmacro Locale "ms"
!insertmacro Locale "nb"
!insertmacro Locale "nl"
!insertmacro Locale "nn"
!insertmacro Locale "oc"
!insertmacro Locale "pl"
!insertmacro Locale "pt"
!insertmacro Locale "pt_BR"
!insertmacro Locale "ro"
!insertmacro Locale "ru"
!insertmacro Locale "sk"
!insertmacro Locale "sr"
!insertmacro Locale "sr@latin"
!insertmacro Locale "sv"
!insertmacro Locale "tr"
!insertmacro Locale "uk"
!insertmacro Locale "vi"
!insertmacro Locale "zh_CN"
!insertmacro Locale "zh_TW"
SectionGroupEnd
#############################################################################
Section -AdditionalIcons
SetOutPath "${GNM_ROOT}\bin"
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${GNM_APPNAME}.lnk" "${GNM_ROOT}\bin\gnumeric.exe"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${GNM_APPNAME} Help.lnk" "${GNM_ROOT}\${GNM_HELP}"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "${GNM_ROOT}\bin\uninst.exe"
SectionEnd
Section -Post
SetOutPath "$INSTDIR"
WriteUninstaller "${GNM_ROOT}\bin\uninst.exe"
WriteRegStr SHCTX "${GNM_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr SHCTX "${GNM_UNINST_KEY}" "UninstallString" "${GNM_ROOT}\bin\uninst.exe"
WriteRegStr SHCTX "${GNM_UNINST_KEY}" "DisplayVersion" "${GNM_VERSION_FULL}"
WriteRegStr SHCTX "${GNM_UNINST_KEY}" "${GNM_STARTMENU_REG_VAL}" "$ICONS_GROUP"
WriteRegStr SHCTX "${GNM_UNINST_KEY}" "Context" "$ISADMIN"
WriteRegStr SHCTX "${GNM_UNINST_KEY}" "RootDir" "$INSTDIR"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} ""
!insertmacro MUI_FUNCTION_DESCRIPTION_END
LangString TEXT_IO_TITLE_OP1 ${LANG_ENGLISH} "Install Option"
LangString TEXT_IO_SUBTITLE_OP1 ${LANG_ENGLISH} "You can choose to install ${GNM_NAME} for anyone who uses this computer or only you."
Function CustomPageShortcut
ClearErrors
UserInfo::GetName
IfErrors Win9x
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" 0 not_admin
Win9x:
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE_OP1)" "$(TEXT_IO_SUBTITLE_OP1)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "op1.ini"
!insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "op1.ini" "Field 2" "State"
StrCmp $INI_VALUE "1" 0 not_admin
StrCpy $ISADMIN "1"
SetShellVarContext all
Goto done
not_admin:
StrCpy $ISADMIN "0"
SetShellVarContext current
done:
FunctionEnd
Function .onInit
InitPluginsDir
; !insertmacro MUI_INSTALLOPTIONS_EXTRACT "op1.ini"
; !insertmacro MUI_INSTALLOPTIONS_EXTRACT "op3.ini"
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Section Uninstall
Push $1
ReadRegStr $INSTDIR SHCTX "${GNM_UNINST_KEY}" "RootDir"
SetOutPath "$INSTDIR"
RMDir /r /REBOOTOK "${GNM_ROOT}"
ReadRegStr $ISADMIN SHCTX "${GNM_UNINST_KEY}" "Context"
StrCmp $ISADMIN "1" 0 +2
SetShellVarContext all
ReadRegStr $ICONS_GROUP SHCTX "${GNM_UNINST_KEY}" "${GNM_STARTMENU_REG_VAL}"
Delete "$SMPROGRAMS\$ICONS_GROUP\${GNM_APPNAME}.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\${GNM_APPNAME} Help.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
RMDir "$SMPROGRAMS\$ICONS_GROUP"
GetFullPathName /SHORT $SHORTINSTDIR ${GNM_ROOT}
DeleteRegKey SHCTX "${GNM_UNINST_KEY}"
ReadRegStr $1 SHCTX "Software\GNOME\${GNM_NAME}" "Path"
StrCmp $1 "${GNM_ROOT}" 0 +2
DeleteRegValue SHCTX "Software\GNOME\${GNM_NAME}" "Path"
DeleteRegKey /ifempty SHCTX "Software\GNOME\${GNM_NAME}"
DeleteRegKey /ifempty SHCTX "Software\GNOME"
# SetAutoClose true
Pop $1
SectionEnd
|