#13 add this installer code for windows

None
closed
nobody
None
5
2013-04-15
2009-09-26
Jim Michaels
No

included here is an NSIS installer for Windows. modify as needed.

Discussion

  • Arthur Norman
    Arthur Norman
    2009-09-26

    Many thanks - I have checked that into the "scripts" directory with a longer file-name. I need to spend tome reading the nsis manual before I try it, and I may want to work out a strategy for me to cope with version numbers... but that is something I have wanted to get done for some time and your script is a big help. Arthur

     
  • Jim Michaels
    Jim Michaels
    2009-09-26

    you will need to copy the Processes.dll plugin from the following site into your plugins directory (C:\Program Files\NSIS\Plugins\)

    http://nsis.sourceforge.net/Processes_plug-in

    it allows you to kill processes during uninstallation. in this case, anything with the name "reduce".

    to compile the NSIS file, you need to
    1. install NSIS compiler
    2. start NSIS.
    3. from the choices, choose "compile NSI scripts"

     
  • Jim Michaels
    Jim Michaels
    2009-09-26

    you will need to copy the Processes.dll plugin from the following site into your plugins directory (C:\Program Files\NSIS\Plugins\)

    http://nsis.sourceforge.net/Processes_plug-in

    it allows you to kill processes during uninstallation. in this case, anything with the name "reduce".

    to compile the NSIS file, you need to
    1. install NSIS compiler
    2. start NSIS.
    3. from the choices, choose "compile NSI scripts"

     
  • Jim Michaels
    Jim Michaels
    2009-09-27

    examine the file structure required for setup.nsi. I added 2 pdf's, the sl.pdf and the

    note that the output for setup.nsi is not setup.exe, it is reduce-20090226-setup.exe. you set that within the setup.nsi file near the top on line 21 with the Outfile command.

    working with NSIS is like working with a macro assembly language. it uses a stack for pretty much everything, including win32 calls as you will see within (the Mutex call for instance in .onInit function). except this language has functions. there is a .onInit function which you can define which is called before everything else on startup, and there is something like .uninit called just before uninstallation for initialization and happens before sections are executed.

    sections that start with a - in the string part are executed /by default/ first before other sections. the string part of this section will not be shown, unlike other sections.

    the string part of the section is what is shown as a checkbox in the installer in sections.

    Every Section should have a corresponding
    LangString
    line (1 for each language) and a
    !insertmacro MUI_DESCRIPTION_TEXT
    line, (probably 1 for each language I think, and multiply that by the number of software components being installed - I really don't know how the languages thing works, I didn't look at that example, I only wrote for English, so look it up)

    I changed my code and moved the pdf's into the reduce.doc directory, so the following changes need to be made on lines 257-258:
    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\redlog.lnk" "$INSTDIR\reduce.doc\redlog.pdf"
    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\standard-lisp-manual.lnk" "$INSTDIR\reduce.doc\sl.pdf"

    and lines 326-327:
    Delete "$INSTDIR\reduce.doc\sl.pdf"
    Delete "$INSTDIR\reduce.doc\redlog.pdf"

    at least I think that's what it is if I haven't changed a lot of stuff since posting.
    I can't seem to repost the file.

    this is the directory structure you should have when compiling.
    --------------------------
    \guardian.red
    \license.htm
    \license.txt
    \reduce-20090226-setup.exe
    \reduce.com
    \reduce.doc
    \reduce.exe
    \reduce.fonts
    \reduce.img
    \setup.nsi
    \reduce.doc\abstract.tex
    \reduce.doc\acknowl.tex
    \reduce.doc\appenda.tex
    \reduce.doc\aprop.tex
    \reduce.doc\cfrac.tex
    \reduce.doc\command.tex
    \reduce.doc\convert.tex
    \reduce.doc\exprn.tex
    \reduce.doc\header.tex
    \reduce.doc\hephys.tex
    \reduce.doc\heugcd.tex
    \reduce.doc\index.html
    \reduce.doc\inter.tex
    \reduce.doc\intro.tex
    \reduce.doc\io.tex
    \reduce.doc\list.tex
    \reduce.doc\macros.tex
    \reduce.doc\maintain.tex
    \reduce.doc\manual.tex
    \reduce.doc\map.tex
    \reduce.doc\matrix.tex
    \reduce.doc\oper.tex
    \reduce.doc\oper2.tex
    \reduce.doc\polyrat.tex
    \reduce.doc\proc.tex
    \reduce.doc\progstr.tex
    \reduce.doc\r38_0001.html
    \reduce.doc\r38_0050.html
    \reduce.doc\r38_0100.html
    \reduce.doc\r38_0150.html
    \reduce.doc\r38_0200.html
    \reduce.doc\r38_0250.html
    \reduce.doc\r38_0300.html
    \reduce.doc\r38_0350.html
    \reduce.doc\r38_0400.html
    \reduce.doc\r38_0450.html
    \reduce.doc\r38_0500.html
    \reduce.doc\r38_0550.html
    \reduce.doc\r38_0600.html
    \reduce.doc\r38_0650.html
    \reduce.doc\r38_idx.html
    \reduce.doc\redlog.pdf
    \reduce.doc\redlogo.gif
    \reduce.doc\rememb.tex
    \reduce.doc\rest.tex
    \reduce.doc\rlisp88.tex
    \reduce.doc\rlispref.tex
    \reduce.doc\sl.pdf
    \reduce.doc\solve.tex
    \reduce.doc\statemnt.tex
    \reduce.doc\structr.tex
    \reduce.doc\subst.tex
    \reduce.doc\symbolic.tex
    \reduce.doc\title.tex
    \reduce.doc\util.tex
    \reduce.fonts\cmex10.pfa
    \reduce.fonts\cmex10.pfb
    \reduce.fonts\cmex10.ttf
    \reduce.fonts\cmex7.ttf
    \reduce.fonts\cmex8.ttf
    \reduce.fonts\cmex9.ttf
    \reduce.fonts\cmmi10.pfa
    \reduce.fonts\cmmi10.pfb
    \reduce.fonts\cmmi10.ttf
    \reduce.fonts\cmmi12.ttf
    \reduce.fonts\cmmi5.ttf
    \reduce.fonts\cmmi6.ttf
    \reduce.fonts\cmmi7.ttf
    \reduce.fonts\cmmi8.ttf
    \reduce.fonts\cmmi9.ttf
    \reduce.fonts\cmr10.pfa
    \reduce.fonts\cmr10.pfb
    \reduce.fonts\cmr10.ttf
    \reduce.fonts\cmr12.ttf
    \reduce.fonts\cmr17.ttf
    \reduce.fonts\cmr5.ttf
    \reduce.fonts\cmr6.ttf
    \reduce.fonts\cmr7.ttf
    \reduce.fonts\cmr8.ttf
    \reduce.fonts\cmr9.ttf
    \reduce.fonts\cmsy10.pfa
    \reduce.fonts\cmsy10.pfb
    \reduce.fonts\cmsy10.ttf
    \reduce.fonts\cmsy5.ttf
    \reduce.fonts\cmsy6.ttf
    \reduce.fonts\cmsy7.ttf
    \reduce.fonts\cmsy8.ttf
    \reduce.fonts\cmsy9.ttf
    \reduce.fonts\fonts.dir
    \reduce.fonts\fonts.scale
    \reduce.fonts\pfmfiles
    \reduce.fonts\README
    \reduce.fonts\README.BaKoMa
    \reduce.fonts\README.cmps-fonts
    \reduce.fonts\src
    \reduce.fonts\pfmfiles\cmex10.pfm
    \reduce.fonts\pfmfiles\cmmi10.pfm
    \reduce.fonts\pfmfiles\cmr10.pfm
    \reduce.fonts\pfmfiles\cmsy10.pfm
    \reduce.fonts\src\cmex10.asm.gz
    \reduce.fonts\src\cmmi10.asm.gz
    \reduce.fonts\src\cmr10.asm.gz
    \reduce.fonts\src\cmsy10.asm.gz

     
  • Jim Michaels
    Jim Michaels
    2009-09-27

    corrected setup.nsi file

     
    Attachments
  • Jim Michaels
    Jim Michaels
    2009-09-27

    corrected setup.nsi file on this bug (figured out how) - wow sf.net UI has changed.

     
  • Jim Michaels
    Jim Michaels
    2009-09-27

    I forgot to mention that the way I wrote this setup.nsi file, it is a standalone setup file, it needs no outside files. basically, you place the .nsi file in the same directory as the files you wish to install, and when you compile, NSIS will add them
    (compressed) using the File command into the setup .EXE, and because of the /r, it will keep the same directory structure. when you access the files using CopyFiles, you access them simply from "\whatever"

    $SMPROGRAMS is the ...Start Menu\Programs. which user it is (all users or current user) is determined by
    SetShellVarContext all
    $INSTDIR is the

    If you are distributing this on ISOs, $EXEDIR is the drive letter and directory path that setup is being executed from on the cd when it is in the drive. you use that in the Sections.

    If you are making ISOs (for instance, if you distribute a linux, mac, and windows version), you will need an autorun.inf for windows use.
    this makes the cd automatically run whatever you want (like a setup file) when the cd is inserted.
    it basically contains 2 lines and is an ANSI text file created with NOTEPAD or similar text editor:
    (it can even open a web page if you wish)
    [autorun]
    OPEN=reduce-20090226-setup.exe

    you can make ISO files using http://sf.net/projects/cdrtfe and copy the cygwin dll's from the cygwin directory into the cdrtools directory. then you can use mkisofs to make ISOs. mkisofs should be in your PATH or the path should be embedded in a batch file. If you wish I can attach a batch file I use to call mkisofs which reduces the typing to just 4 parameters: appid, publisher, volid, directory.
    it is called makeiso.cmd.

    well, that is NSIS in a nutshell. the rest is details in the manual and googling for answers. if you have any questions, don't hesitate to email me at
    http://JesusnJim.com/contactme.php

     
  • Jim Michaels
    Jim Michaels
    2009-09-27

    makeiso.cmd - batch file wraparound for mkisofs

     
    Attachments
  • Jim Michaels
    Jim Michaels
    2009-09-27

    sample autorun.inf for cd ISO.

     
    Attachments
  • Jim Michaels
    Jim Michaels
    2010-04-15

    I made a lot of unnecessary code using the CopyFiles command.
    the Files command archives the files into the setup program, and when you run the installer, it uncompresses all the files into place for you. I found this out later.

    I also learned that it's necessary to have the executable in the same directory as the .nsi installer script, or nothing (like the the program shortcuts you create) seems to work right.

    the destination directory I chose was $PROGRAMFILES\Reduce\ through the command
    InstallDir "$PROGRAMFILES\Reduce"
    which on most windows installations is C:\Program Files\reduce\. I chose not to date the destination directory in case someone wants to upgrade, they can upgrade in-place by the installer simply replacing files. If that is a problem during installation, simply add a
    DeleteFile "$INSTDIR\somefile"
    command.

    I am going to submit a setup.nsi file for the new version of reduce, this time with better documentation as to where to get the necessary NSIS plugins to compile the script. I don't think it requires anything special, but I want to make sure you have anything I've got so it works.

    there is a separate include file for 64-bit OS detection and IF-then-else's if you ever get to that point.

     
  • Jim Michaels
    Jim Michaels
    2010-04-15

    there are some structural changes I needed to make to the latest release of the new setup.nsi as well, since I had not noticed that you put some newer pdfs in the docs directory. cool!

     
  • Jim Michaels
    Jim Michaels
    2010-04-16

    setup.nsi installer script for 20091021 with changes and some documentation

     
    Attachments
  • Jim Michaels
    Jim Michaels
    2010-04-16

    you will be able to find the installer at
    http://JesusnJim.com/z/reduce-20091021-setup.exe
    the installer will expand the file structure I outlined into c:\program files\Reduce\ If you need a different directory because of vista/7 such as c:\reduce, let me know and I will change the InstallDir command in the script.

     
  • Rainer Schöpf
    Rainer Schöpf
    2013-04-15

    • status: open --> closed
    • Group: -->
     
  • Rainer Schöpf
    Rainer Schöpf
    2013-04-15

    Installer code for windows in progress