Mercurial > mxe-octave
comparison tools/makeinst-script.sh.in @ 4793:202fa20cf559
add msys2 environment/tools option, use seprate post-install script to finalize install
* src/msys2-bash.mk: new file
* src/msys2-coreutils.mk: new file
* src/msys2-diffutils.mk: new file
* src/msys2-dos2unix.mk: new file
* src/msys2-filesystem.mk: new file
* src/msys2-findutils.mk: new file
* src/msys2-gawk.mk: new file
* src/msys2-gcc-libs.mk: new file
* src/msys2-gmp.mk: new file
* src/msys2-gnupg.mk: new file
* src/msys2-grep.mk: new file
* src/msys2-gzip.mk: new file
* src/msys2-icu.mk: new file
* src/msys2-info.mk: new file
* src/msys2-less.mk: new file
* src/msys2-libassuan.mk: new file
* src/msys2-libbz2.mk: new file
* src/msys2-libexpat.mk: new file
* src/msys2-libgpg-error.mk: new file
* src/msys2-libgpgme.mk: new file
* src/msys2-libiconv.mk: new file
* src/msys2-libidn2.mk: new file
* src/msys2-libintl.mk: new file
* src/msys2-liblzma.mk: new file
* src/msys2-libmetalink.mk: new file
* src/msys2-libopenssl.mk: new file
* src/msys2-libpcre.mk: new file
* src/msys2-libpsl.mk: new file
* src/msys2-libreadline.mk: new file
* src/msys2-libunistring.mk: new file
* src/msys2-libutil-linux.mk: new file
* src/msys2-libxml2.mk: new file
* src/msys2-make.mk: new file
* src/msys2-mintty.mk: new file
* src/msys2-ncurses.mk: new file
* src/msys2-pacman-mirrors.mk: new file
* src/msys2-pacman.mk: new file
* src/msys2-patch.mk: new file
* src/msys2-runtime.mk: new file
* src/msys2-sed.mk: new file
* src/msys2-tar.mk: new file
* src/msys2-unzip.mk: new file
* src/msys2-wget.mk: new file
* src/msys2-zip.mk: new file
* src/msys2-zlib.mk: new file
* src/msys2-mpfr.mk: new file
* src/msys2-libsqlite.mk: new file
* src/msys2-keyring.mk: new file
* src/msys2-libffi.mk: new file
* src/msys2-libgnutls.mk: new file
* src/msys2-libhogweed.mk: new file
* src/msys2-libksba.mk: new file
* src/msys2-libnettle.mk: new file
* src/msys2-libnpth.mk: new file
* src/msys2-libp11-kit.mk: new file
* src/msys2-libtasn1.mk: new file
* src/src-msys2-bash.mk: new file
* src/src-msys2-coreutils.mk: new file
* src/src-msys2-diffutils.mk: new file
* src/src-msys2-dos2unix.mk: new file
* src/src-msys2-filesystem.mk: new file
* src/src-msys2-findutils.mk: new file
* src/src-msys2-gawk.mk: new file
* src/src-msys2-gcc-libs.mk: new file
* src/src-msys2-gmp.mk: new file
* src/src-msys2-gnupg.mk: new file
* src/src-msys2-grep.mk: new file
* src/src-msys2-gzip.mk: new file
* src/src-msys2-icu.mk: new file
* src/src-msys2-info.mk: new file
* src/src-msys2-keyring.mk: new file
* src/src-msys2-less.mk: new file
* src/src-msys2-libassuan.mk: new file
* src/src-msys2-libbz2.mk: new file
* src/src-msys2-libexpat.mk: new file
* src/src-msys2-libffi.mk: new file
* src/src-msys2-libgcrypt.mk: new file
* src/src-msys2-libgnutls.mk: new file
* src/src-msys2-libgpg-error.mk: new file
* src/src-msys2-libgpgme.mk: new file
* src/src-msys2-libhogweed.mk: new file
* src/src-msys2-libiconv.mk: new file
* src/src-msys2-libidn2.mk: new file
* src/src-msys2-libintl.mk: new file
* src/src-msys2-libksba.mk: new file
* src/src-msys2-liblzma.mk: new file
* src/src-msys2-libmetalink.mk: new file
* src/src-msys2-libnettle.mk: new file
* src/src-msys2-libnpth.mk: new file
* src/src-msys2-libopenssl.mk: new file
* src/src-msys2-libp11-kit.mk: new file
* src/src-msys2-libpcre.mk: new file
* src/src-msys2-libpsl.mk: new file
* src/src-msys2-libreadline.mk: new file
* src/src-msys2-libsqlite.mk: new file
* src/src-msys2-libtasn1.mk: new file
* src/src-msys2-libunistring.mk: new file
* src/src-msys2-libutil-linux.mk: new file
* src/src-msys2-libxml2.mk: new file
* src/src-msys2-make.mk: new file
* src/src-msys2-mintty.mk: new file
* src/src-msys2-mpfr.mk: new file
* src/src-msys2-ncurses.mk: new file
* src/src-msys2-pacman-mirrors.mk: new file
* src/src-msys2-pacman.mk: new file
* src/src-msys2-patch.mk: new file
* src/src-msys2-runtime.mk: new file
* src/src-msys2-sed.mk: new file
* src/src-msys2-tar.mk: new file
* src/src-msys2-unzip.mk: new file
* src/src-msys2-wget.mk: new file
* src/src-msys2-zip.mk: new file
* src/src-msys2-zlib.mk: new file
* Makefile.in: add msys2 vars and base rules
* index.html: ref new msys2 targets
* dist-files.mk: added refs to new msys2 mk files
* binary-dist-rules.mk: added conditional msys/msys2 dist files, post-install.bat
* configure.ac: added --with-msys2 option
* installer-files/post-install.bat: new file
* tools/makeinst-script.sh.in: call post-install.bat instead of fc_update and octave,
and use nsExec to hide comd windows while executing it
* tools/msys2-install.py; new file
* installer-files/cmdshell.bat, installer-files/fc_update.bat,
installer-files/octave-firsttime.vbs, installer-files/octave.vbs:
update paths when running msys2
author | John Donoghue |
---|---|
date | Wed, 15 Aug 2018 08:05:01 -0400 |
parents | 68deb4d4d928 |
children | adc0217b36c0 |
comparison
equal
deleted
inserted
replaced
4792:ade16902356d | 4793:202fa20cf559 |
---|---|
14 OCTAVE_SOURCE=`basename $1` | 14 OCTAVE_SOURCE=`basename $1` |
15 | 15 |
16 cd `dirname $1` | 16 cd `dirname $1` |
17 MXEDIR=`cd ..; pwd` | 17 MXEDIR=`cd ..; pwd` |
18 | 18 |
19 if [ -e $OCTAVE_SOURCE/bin/libopenblas.dll ]; then | 19 if [ "@USE_MSYS2@" == "yes" ]; then |
20 if [ "@ENABLE_WINDOWS_64@" == "yes" ]; then | |
21 OCTAVE_SUBDIR=mingw64 | |
22 else | |
23 OCTAVE_SUBDIR=mingw32 | |
24 fi | |
25 else | |
26 OCTAVE_SUBDIR= | |
27 fi | |
28 | |
29 | |
30 if [ -e $OCTAVE_SOURCE/$OCTAVE_SUBDIR/bin/libopenblas.dll ]; then | |
20 DEFAULT_BLAS="OpenBLAS" | 31 DEFAULT_BLAS="OpenBLAS" |
21 else | 32 else |
22 DEFAULT_BLAS="Reference BLAS" | 33 DEFAULT_BLAS="Reference BLAS" |
23 fi | 34 fi |
24 | |
25 | 35 |
26 # find octave shortcut icon | 36 # find octave shortcut icon |
27 ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P\n" | head -1 | sed 's,/,\\\\,g'` | 37 ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P\n" | head -1 | sed 's,/,\\\\,g'` |
28 | 38 |
29 # extract version number | 39 # extract version number |
178 | 188 |
179 \${NSD_CreateDropList} 120u 70 100u 80u "" | 189 \${NSD_CreateDropList} 120u 70 100u 80u "" |
180 Pop \$InstallBlasLibCtrl | 190 Pop \$InstallBlasLibCtrl |
181 EOF | 191 EOF |
182 # add option to install libopenblas if we have the dll present | 192 # add option to install libopenblas if we have the dll present |
183 if [ -e $OCTAVE_SOURCE/bin/libopenblas.dll ]; then | 193 if [ -e $OCTAVE_SOURCE/$OCTAVE_SUBDIR/bin/libopenblas.dll ]; then |
184 cat >> $OUTFILE << EOF | 194 cat >> $OUTFILE << EOF |
185 \${NSD_CB_AddString} \$InstallBlasLibCtrl "OpenBLAS" | 195 \${NSD_CB_AddString} \$InstallBlasLibCtrl "OpenBLAS" |
186 EOF | 196 EOF |
187 fi | 197 fi |
188 cat >> $OUTFILE << EOF | 198 cat >> $OUTFILE << EOF |
237 ; include octave.vbs and other scripts | 247 ; include octave.vbs and other scripts |
238 SetOutPath "\$INSTDIR" | 248 SetOutPath "\$INSTDIR" |
239 File "$OCTAVE_SOURCE/octave.vbs" | 249 File "$OCTAVE_SOURCE/octave.vbs" |
240 File "$OCTAVE_SOURCE/octave-firsttime.vbs" | 250 File "$OCTAVE_SOURCE/octave-firsttime.vbs" |
241 File "$OCTAVE_SOURCE/fc_update.bat" | 251 File "$OCTAVE_SOURCE/fc_update.bat" |
252 File "$OCTAVE_SOURCE/post-install.bat" | |
242 | 253 |
243 File "$OCTAVE_SOURCE/HG-ID" | 254 File "$OCTAVE_SOURCE/HG-ID" |
244 | 255 |
245 ; distro files | 256 ; distro files |
246 EOF | 257 EOF |
261 cat >> $OUTFILE << EOF | 272 cat >> $OUTFILE << EOF |
262 | 273 |
263 ; add qt.conf | 274 ; add qt.conf |
264 Push \$0 | 275 Push \$0 |
265 \${StrRep} '\$0' '\$INSTDIR' '\\' '/' | 276 \${StrRep} '\$0' '\$INSTDIR' '\\' '/' |
266 WriteINIStr "\$INSTDIR\\bin\\qt.conf" "Paths" "Prefix" "\$0" | 277 WriteINIStr "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\qt.conf" "Paths" "Prefix" "\$0" |
267 WriteINIStr "\$INSTDIR\\bin\\qt.conf" "Paths" "Translations" "translations" | 278 WriteINIStr "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\qt.conf" "Paths" "Translations" "translations" |
268 Pop \$0 | 279 Pop \$0 |
269 | 280 |
270 ; run fc-cache updater | 281 ; run post-install script |
271 GetFullPathName /SHORT \$1 \$INSTDIR | 282 GetFullPathName /SHORT \$1 \$INSTDIR |
272 DetailPrint "Building font cache (may take a while)" | 283 DetailPrint "Running post install script (May take a while) ..." |
273 ExecWait "\$1\\fc_update.bat" | 284 ;ExecWait "\$1\\post-install.bat" |
285 ; run in hidden console window | |
286 nsExec::Exec /TIMEOUT=30000 '"\$1\\post-install.bat"' | |
287 Pop \$0 | |
274 SectionEnd | 288 SectionEnd |
275 | 289 |
276 Section make_uninstaller | 290 Section make_uninstaller |
277 ; Write the uninstall keys for Windows | 291 ; Write the uninstall keys for Windows |
278 SetOutPath "\$INSTDIR" | 292 SetOutPath "\$INSTDIR" |
299 CreateShortCut "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (CLI).lnk" "\$INSTDIR\\octave.vbs" "--no-gui" "\$INSTDIR\\$ICON" 0 SW_SHOWMINIMIZED | 313 CreateShortCut "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (CLI).lnk" "\$INSTDIR\\octave.vbs" "--no-gui" "\$INSTDIR\\$ICON" 0 SW_SHOWMINIMIZED |
300 CreateShortCut "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (GUI).lnk" "\$INSTDIR\\octave.vbs" "--force-gui" "\$INSTDIR\\$ICON" 0 SW_SHOWMINIMIZED | 314 CreateShortCut "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (GUI).lnk" "\$INSTDIR\\octave.vbs" "--force-gui" "\$INSTDIR\\$ICON" 0 SW_SHOWMINIMIZED |
301 SetOutPath "\$INSTDIR" | 315 SetOutPath "\$INSTDIR" |
302 | 316 |
303 ; fix the shortcuts for appid | 317 ; fix the shortcuts for appid |
304 ExecWait '"\$INSTDIR\\bin\\win7appid.exe" "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (GUI).lnk" "gnu.octave.$VERSION"' | 318 ; run in hidden console window |
319 nsExec::Exec /TIMEOUT=30000 '"\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\win7appid.exe" "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (GUI).lnk" "gnu.octave.$VERSION"' | |
320 Pop \$0 | |
305 EOF | 321 EOF |
306 # shortcut for cmd win | 322 # shortcut for cmd win |
307 if [ -f $OCTAVE_SOURCE/cmdshell.bat ]; then | 323 if [ -f $OCTAVE_SOURCE/cmdshell.bat ]; then |
308 echo "CreateShortCut '\$SMPROGRAMS\\GNU Octave $VERSION\\Bash Shell.lnk' '\$INSTDIR\\cmdshell.bat' '' '' 0" >> $OUTFILE | 324 echo "CreateShortCut '\$SMPROGRAMS\\GNU Octave $VERSION\\Bash Shell.lnk' '\$INSTDIR\\cmdshell.bat' '' '' 0" >> $OUTFILE |
309 fi | 325 fi |
346 have_ver_str: | 362 have_ver_str: |
347 SetOutPath "%USERPROFILE%" | 363 SetOutPath "%USERPROFILE%" |
348 CreateShortCut "\$desktop\\GNU Octave (CLI).lnk" "\$R0\\octave.vbs" "--no-gui" "\$R2" 0 SW_SHOWMINIMIZED | 364 CreateShortCut "\$desktop\\GNU Octave (CLI).lnk" "\$R0\\octave.vbs" "--no-gui" "\$R2" 0 SW_SHOWMINIMIZED |
349 CreateShortCut "\$desktop\\GNU Octave (GUI).lnk" "\$R0\\octave.vbs" "--force-gui" "\$R2" 0 SW_SHOWMINIMIZED | 365 CreateShortCut "\$desktop\\GNU Octave (GUI).lnk" "\$R0\\octave.vbs" "--force-gui" "\$R2" 0 SW_SHOWMINIMIZED |
350 | 366 |
351 ExecWait '"\$INSTDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"' | 367 nsExec::Exec /TIMEOUT=30000 '"\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"' |
368 Pop \$0 | |
352 | 369 |
353 Pop \$R2 | 370 Pop \$R2 |
354 Pop \$R1 | 371 Pop \$R1 |
355 Pop \$R0 | 372 Pop \$R0 |
356 \${Endif} | 373 \${Endif} |
357 | 374 |
358 ; BLAS set up | 375 ; BLAS set up |
359 \${If} \$InstallBlasLib == 1 | 376 \${If} \$InstallBlasLib == 1 |
360 ; Reference BLAS | 377 ; Reference BLAS |
361 CopyFiles /SILENT "\$INSTDIR\\bin\\librefblas.dll" "\$INSTDIR\\bin\\libblas.dll" | 378 CopyFiles /SILENT "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\librefblas.dll" "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\libblas.dll" |
362 \${Else} | 379 \${Else} |
363 ; OpenBLAS | 380 ; OpenBLAS |
364 CopyFiles /SILENT "\$INSTDIR\\bin\\libopenblas.dll" "\$INSTDIR\\bin\\libblas.dll" | 381 CopyFiles /SILENT "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\libopenblas.dll" "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\libblas.dll" |
365 \${EndIf} | 382 \${EndIf} |
366 | 383 |
367 SectionEnd | 384 SectionEnd |
368 | 385 |
369 Section "FileTypeRego" | 386 Section "FileTypeRego" |
381 WriteRegStr HKCR ".m" "" "Octave.Document.$VERSION" | 398 WriteRegStr HKCR ".m" "" "Octave.Document.$VERSION" |
382 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "RegisteredFileType" 1 | 399 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "RegisteredFileType" 1 |
383 \${EndIf} | 400 \${EndIf} |
384 SectionEnd | 401 SectionEnd |
385 | 402 |
386 Section "InstallPackages" | |
387 ; fix the installed packages (if any) | |
388 GetFullPathName /SHORT \$1 \$INSTDIR | |
389 SetOutPath "\$1" | |
390 ExecWait '"\$1\\bin\\octave-cli.exe" --no-gui -W -H -f -q --eval "pkg rebuild"' \$0 | |
391 SectionEnd | |
392 | |
393 Section "Uninstall" | 403 Section "Uninstall" |
394 | 404 |
395 ReadRegDWORD \$0 HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "AllUsers" | 405 ReadRegDWORD \$0 HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "AllUsers" |
396 IfErrors not_all_users | 406 IfErrors not_all_users |
397 | 407 |
456 | 466 |
457 check_gui_shortcut: | 467 check_gui_shortcut: |
458 IfFileExists "\$desktop\\GNU Octave (GUI).lnk" 0 done_remove_desktop_shortcuts | 468 IfFileExists "\$desktop\\GNU Octave (GUI).lnk" 0 done_remove_desktop_shortcuts |
459 SetOutPath "%USERPROFILE%" | 469 SetOutPath "%USERPROFILE%" |
460 CreateShortCut "\$desktop\\GNU Octave (GUI).lnk" "\$R0\\octave.vbs" "--force-gui" "\$R2" 0 SW_SHOWMINIMIZED | 470 CreateShortCut "\$desktop\\GNU Octave (GUI).lnk" "\$R0\\octave.vbs" "--force-gui" "\$R2" 0 SW_SHOWMINIMIZED |
461 ExecWait '"\$INSTDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"' | 471 nsExec::Exec /TIMEOUT=30000 '"\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"' |
472 Pop \$0 | |
462 | 473 |
463 GoTo done_remove_desktop_shortcuts | 474 GoTo done_remove_desktop_shortcuts |
464 | 475 |
465 remove_desktop_shortcuts: | 476 remove_desktop_shortcuts: |
466 Delete "\$desktop\\GNU Octave (CLI).lnk" | 477 Delete "\$desktop\\GNU Octave (CLI).lnk" |
470 Pop \$R2 | 481 Pop \$R2 |
471 Pop \$R1 | 482 Pop \$R1 |
472 Pop \$R0 | 483 Pop \$R0 |
473 | 484 |
474 ; delete generated qt.conf file | 485 ; delete generated qt.conf file |
475 Delete "\$INSTDIR\\bin\\qt.conf" | 486 Delete "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\qt.conf" |
476 EOF | 487 EOF |
477 | 488 |
478 # insert dir list (backwards order) for uninstall files | 489 # insert dir list (backwards order) for uninstall files |
479 for f in $(find $OCTAVE_SOURCE -depth -type d -printf "%P\n"); do | 490 for f in $(find $OCTAVE_SOURCE -depth -type d -printf "%P\n"); do |
480 winf=`echo $f | sed 's,/,\\\\,g'` | 491 winf=`echo $f | sed 's,/,\\\\,g'` |
612 pop \$0 | 623 pop \$0 |
613 FunctionEnd | 624 FunctionEnd |
614 | 625 |
615 ; Check whether prev install is here and no spaces in dest name | 626 ; Check whether prev install is here and no spaces in dest name |
616 Function CheckPrevInstallAndDest | 627 Function CheckPrevInstallAndDest |
617 IfFileExists "\$INSTDIR\\bin\\octave-cli.exe" inst_exists inst_none | 628 IfFileExists "\$INSTDIR\\bin\\octave-cli.exe" inst_exists 0 |
629 IfFileExists "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\octave-cli.exe" inst_exists inst_none | |
618 inst_exists: | 630 inst_exists: |
619 MessageBox MB_YESNO|MB_ICONEXCLAMATION "Another Octave installation has been detected at that destination. It is recommended to uninstall it if you intend to use the same installation directory. Do you want to proceed with the installation anyway?" /SD IDYES IDYES inst_none IDNO 0 | 631 MessageBox MB_YESNO|MB_ICONEXCLAMATION "Another Octave installation has been detected at that destination. It is recommended to uninstall it if you intend to use the same installation directory. Do you want to proceed with the installation anyway?" /SD IDYES IDYES inst_none IDNO 0 |
620 Abort | 632 Abort |
621 GoTo inst_end | 633 GoTo inst_end |
622 inst_none: | 634 inst_none: |