File:  [gforth] / gforth / iss.sh
Revision 1.31: download - view: text, annotated - select for diffs
Mon Dec 31 15:25:18 2012 UTC (6 years, 7 months ago) by anton
Branches: MAIN
CVS tags: HEAD
updated copyright year

    1: #!/bin/bash
    2: 
    3: #Copyright (C) 2000,2003,2006,2007,2009,2011,2012 Free Software Foundation, Inc.
    4: 
    5: #This file is part of Gforth.
    6: 
    7: #Gforth is free software; you can redistribute it and/or
    8: #modify it under the terms of the GNU General Public License
    9: #as published by the Free Software Foundation, either version 3
   10: #of the License, or (at your option) any later version.
   11: 
   12: #This program is distributed in the hope that it will be useful,
   13: #but WITHOUT ANY WARRANTY; without even the implied warranty of
   14: #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.#See the
   15: #GNU General Public License for more details.
   16: 
   17: #You should have received a copy of the GNU General Public License
   18: #along with this program; if not, see http://www.gnu.org/licenses/.
   19: 
   20: # This is the horror shell script to create an automatic install for
   21: # Windoze.
   22: # Note that I use sed to create a setup file
   23: 
   24: # use iss.sh >gforth.iss
   25: # copy the resulting *.iss to the location of your Windows installation
   26: # of Gforth, and start the setup compiler there.
   27: 
   28: VERSION=$(cat version)
   29: 
   30: for i in lib/gforth/$VERSION/libcc-named/*.la
   31: do
   32:     sed "s/dependency_libs='.*'/dependency_libs=''/g" <$i >$i+
   33:     mv $i+ $i
   34: done
   35: 
   36: cat <<EOT
   37: ; This is the setup script for Gforth on Windows
   38: ; Setup program is Inno Setup
   39: 
   40: [Setup]
   41: AppName=Gforth
   42: AppVerName=Gforth $VERSION
   43: AppCopyright=Copyright  1995,1996,1997,1998,2000,2003,2006,2007,2008,2009,2010,2011,2012 Free Software Foundation
   44: DefaultDirName={pf}\gforth
   45: DefaultGroupName=Gforth
   46: AllowNoIcons=1
   47: InfoBeforeFile=COPYING
   48: Compression=lzma
   49: DisableStartupPrompt=yes
   50: ChangesEnvironment=yes
   51: OutputBaseFilename=gforth-$VERSION
   52: 
   53: [Messages]
   54: WizardInfoBefore=License Agreement
   55: InfoBeforeLabel=Gforth is free software.
   56: InfoBeforeClickLabel=You don't have to accept the GPL to run the program. You only have to accept this license if you want to modify, copy, or distribute this program.
   57: 
   58: [Components]
   59: Name: "help"; Description: "HTML Documentation"; Types: full
   60: Name: "info"; Description: "GNU info Documentation"; Types: full
   61: Name: "print"; Description: "Postscript Documentation for printout"; Types: full
   62: Name: "objects"; Description: "Compiler generated intermediate stuff"; Types: full
   63: 
   64: [Dirs]
   65: $(make distfiles -f Makedist | tr ' ' '\n' | grep -v CVS | (while read i; do
   66:   while [ ! -z "$i" ]
   67:   do
   68:     if [ -d $i ]; then echo $i; fi
   69:     if [ "${i%/*}" != "$i" ]; then i="${i%/*}"; else i=""; fi
   70:   done
   71: done) | sort -u | sed \
   72:   -e 's:/:\\:g' \
   73:   -e 's,^\(..*\)$,Name: "{app}\\\1",g')
   74: Name: "{app}\doc\gforth"
   75: Name: "{app}\doc\vmgen"
   76: Name: "{app}\lib\gforth\\$VERSION\libcc-named"
   77: Name: "{app}\include\gforth\\$VERSION"
   78: 
   79: [Files]
   80: ; Parameter quick reference:
   81: ;   "Source filename", "Dest. filename", Copy mode, Flags
   82: Source: "README.txt"; DestDir: "{app}"; Flags: isreadme
   83: Source: "c:\cygwin\bin\sh.exe"; DestDir: "{app}"
   84: Source: "c:\cygwin\bin\cygwin1.dll"; DestDir: "{app}"
   85: Source: "c:\cygwin\bin\cyggcc_s-1.dll"; DestDir: "{app}"
   86: Source: "c:\cygwin\bin\cygintl-8.dll"; DestDir: "{app}"
   87: Source: "c:\cygwin\bin\cygiconv-2.dll"; DestDir: "{app}"
   88: Source: "c:\cygwin\bin\cygltdl-7.dll"; DestDir: "{app}"
   89: Source: "c:\cygwin\bin\cygreadline7.dll"; DestDir: "{app}"
   90: Source: "c:\cygwin\bin\cygncursesw-10.dll"; DestDir: "{app}"
   91: Source: "c:\cygwin\bin\cygffi-4.dll"; DestDir: "{app}"
   92: Source: "gforthmi.sh"; DestDir: "{app}"
   93: $(ls doc/gforth | sed -e 's:/:\\:g' -e 's,^\(..*\)$,Source: "doc\\gforth\\\1"; DestDir: "{app}\\doc\\gforth"; Components: help,g')
   94: $(ls doc/vmgen | sed -e 's:/:\\:g' -e 's,^\(..*\)$,Source: "doc\\vmgen\\\1"; DestDir: "{app}\\doc\\vmgen"; Components: help,g')
   95: $(ls lib/gforth/$VERSION/libcc-named | sed -e 's:/:\\:g' -e 's,^\(..*\)$,Source: "lib\\gforth\\'$VERSION'\\libcc-named\\\1"; DestDir: "{app}\\lib\\gforth\\'$VERSION'\\libcc-named",g')
   96: $(ls lib/gforth/$VERSION/libcc-named/.libs | sed -e 's:/:\\:g' -e 's,^\(..*\)$,Source: "lib\\gforth\\'$VERSION'\\libcc-named\\.libs\\\1"; DestDir: "{app}\\lib\\gforth\\'$VERSION'\\libcc-named\\.libs",g')
   97: $(ls include/gforth/$VERSION | sed -e 's:/:\\:g' -e 's,^\(..*\)$,Source: "engine\\\1"; DestDir: "{app}\\include\\gforth\\'$VERSION'",g')
   98: $(make distfiles -f Makedist EXE=.exe | tr ' ' '\n' | grep -v engine.*exe | (while read i; do
   99:   if [ ! -d $i ]; then echo $i; fi
  100: done) | sed \
  101:   -e 's:/:\\:g' \
  102:   -e 's,^\(..*\)\\\([^\\]*\)$,Source: "\1\\\2"; DestDir: "{app}\\\1",g' \
  103:   -e 's,^\([^\\]*\)$,Source: "\1"; DestDir: "{app}",g' \
  104:   -e 's,^\(.*\.[oib]".*\),\1; Components: objects,g' \
  105:   -e 's,^\(.*\.p\)s\(".*\),\1df\2; Components: print,g' \
  106:   -e 's,^\(.*\.info.*".*\),\1; Components: info,g')
  107: 
  108: [Icons]
  109: ; Parameter quick reference:
  110: ;   "Icon title", "File name", "Parameters", "Working dir (can leave blank)",
  111: ;   "Custom icon filename (leave blank to use the default icon)", Icon index
  112: Name: "{group}\Gforth"; Filename: "{app}\gforth.exe"; WorkingDir: "{app}"
  113: Name: "{group}\Gforth-fast"; Filename: "{app}\gforth-fast.exe"; WorkingDir: "{app}"
  114: Name: "{group}\Gforth-dict"; Filename: "{app}\gforth-dict.exe"; WorkingDir: "{app}"
  115: Name: "{group}\Gforth-itc"; Filename: "{app}\gforth-itc.exe"; WorkingDir: "{app}"
  116: Name: "{group}\Gforth Manual"; Filename: "{app}\doc\gforth\index.html"; WorkingDir: "{app}"; Components: help
  117: Name: "{group}\Gforth Manual (PDF)"; Filename: "{app}\doc\gforth.pdf"; WorkingDir: "{app}"; Components: help
  118: Name: "{group}\VMgen Manual"; Filename: "{app}\doc\vmgen\index.html"; WorkingDir: "{app}"; Components: help
  119: Name: "{group}\Bash"; Filename: "{app}\sh.exe"; WorkingDir: "{app}"
  120: Name: "{group}\Uninstall Gforth"; Filename: "{uninstallexe}"
  121: 
  122: [Run]
  123: Filename: "{app}\sh.exe"; WorkingDir: "{app}"; Parameters: "-c ""./gforthmi.sh || read"""
  124: Filename: "{app}\sh.exe"; WorkingDir: "{app}"; Parameters: "-c ""./gforth fixpath.fs gforth-fast.exe || read"""
  125: Filename: "{app}\sh.exe"; WorkingDir: "{app}"; Parameters: "-c ""./gforth fixpath.fs gforth-ditc.exe || read"""
  126: Filename: "{app}\sh.exe"; WorkingDir: "{app}"; Parameters: "-c ""./gforth fixpath.fs gforth-itc.exe || read"""
  127: Filename: "{app}\sh.exe"; WorkingDir: "{app}"; Parameters: "-c ""./gforth-fast fixpath.fs gforth.exe || read"""
  128: 
  129: [UninstallDelete]
  130: Type: files; Name: "{app}\gforth.fi"
  131: Type: files; Name: "{app}\temp-image.fi1"
  132: Type: files; Name: "{app}\temp-image.fi2"
  133: 
  134: [Registry]
  135: Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath(ExpandConstant('{app}'))
  136: 
  137: ;[Registry]
  138: ;registry commented out
  139: ; WorkingDir: "{app}"; Parameter quick reference:
  140: ;   "Root key", "Subkey", "Value name", Data type, "Data", Flags
  141: ;HKCR, ".fs"; STRING, "forthstream",
  142: ;HKCR, ".fs", "Content Type", STRING, "application/forth",
  143: ;HKCR, ".fb"; STRING, "forthblock",
  144: ;HKCR, ".fb", "Content Type", STRING, "application/forth-block",
  145: ;HKCR, "forthstream"; STRING, "Forth Source",
  146: ;HKCR, "forthstream", "EditFlags", DWORD, "00000000",
  147: ;HKCR, "forthstream\DefaultIcon"; STRING, "{sys}\System32\shell32.dll,61"
  148: ;HKCR, "forthstream\Shell"; STRING, ""
  149: ;HKCR, "forthstream\Shell\Open\command"; STRING, "{app}\gforth.exe %1"
  150: ;HKCR, "forthblock"; STRING, "Forth Block",
  151: ;HKCR, "forthblock", "EditFlags", DWORD, "00000000",
  152: ;HKCR, "forthblock\DefaultIcon"; STRING, "{sys}\System32\shell32.dll,61"
  153: 
  154: [Code]
  155: function NeedsAddPath(Param: string): boolean;
  156: var
  157:   OrigPath: string;
  158: begin
  159:   if not RegQueryStringValue(HKEY_LOCAL_MACHINE,'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', OrigPath)
  160:   then begin
  161:     Result := True;
  162:     exit;
  163:   end;
  164:   // look for the path with leading and trailing semicolon
  165:   // Pos() returns 0 if not found
  166:   Result := Pos(';' + UpperCase(Param) + ';', ';' + UpperCase(OrigPath) + ';') = 0;  
  167:   if Result = True then
  168:      Result := Pos(';' + UpperCase(Param) + '\;', ';' + UpperCase(OrigPath) + ';') = 0; 
  169: end;
  170: EOT
  171: 
  172: sed -e 's/$/\r/' <README >README.txt

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>