Re: Installing Windows fonts

2005-06-15 Thread Uwe Stöhr

Johann Kellerman wrote:


I know there are only a couple of translated languages. What I propose is create
the other languages as nullsoft languages. For now the installer strings can be
in english until a concerned user post the correct translations. The only string
we can translate for now is the lang environment variable.


I don't know how this can be done but I mean this is confusing as the 
language popup window at the install start asks for the "Installer 
Language". And it wuld also be a bit confusing if it asks for the 
program language and then displays the installer in english.


regards Uwe


Re: Installing Windows fonts

2005-06-15 Thread Uwe Stöhr

Angus Leeming wrote:


Or, perhaps more simply:

  StrCpy $0
"$MiKTeXPath$\r$\n$GhostscriptPath$\r$\n$ImageMagickPath$\r$\n$PythonPath$\r$\n$PerlPath"
  ${StrNSISToIO} $0 $0


Thanks Angus. I implemented it in the actual version:

(http://fkurth.de/uwest/LyX/Installer/lyx_setup_136proposal-v15.exe)

http://fkurth.de/uwest/LyX/Installer/Scripts/


Note that ${StrNSISToIO} is part of StrUtils.nsh...


BTW. It is in StrFunc.nsh

regards Uwe


Re: Installing Windows fonts

2005-06-15 Thread Johann Kellerman
 
>  StrCpy $0
>"$MiKTeXPath$\r$\n$GhostscriptPath$\r$\n$ImageMagickPath$\r$\n$PythonPa
th$\r 
> $\n>$PerlPath"
>  ${StrNSISToIO} $0 $0

>Note that ${StrNSISToIO} is part of StrUtils.nsh...

>You don't want to manipulate (change) $GhostscriptPath et al, 
>because you're actually going to use them later...

It's a bit cleaner solution, was not sure how to escape the \r and \n to
avoid it begin escaped by the escaping StrNSISToIO function Or
something like that


Uwe, attached is the small test script to show page skipping by using 
  !define MUI_PAGE_CUSTOMFUNCTION_PRE ___
And another suggested solution for choosing the fonts by better usage of
the nsi sections & components.

Regards,
Johann


section_and_page_skip.nsi
Description: section_and_page_skip.nsi


Re: Installing Windows fonts

2005-06-15 Thread Angus Leeming
Johann Kellerman wrote:
> So after constructing and writing out the complete path variable to
> anther variable, the one that you send to Angus's plugin. You should
> escape al the path names:
> 
> Push $GhostscriptPath
> Call Nsis2Io
> Pop $GhostscriptPath
> Push $INSTDIR
> Call Nsis2Io
> Pop $R0   ; dont mess with instdir
> Push $MiKTeXPath
> Call Nsis2Io
> Pop $MiKTeXPath
> Push $PerlPath
> Call Nsis2Io
> Pop $PerlPath
> Push $ImageMagickPath
> Call Nsis2Io
> Pop $ImageMagickPath
> Push $PythonPath
> Call Nsis2Io
> Pop $PythonPath
> ;and then only --> note the $R0 change
> !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" \
> "$R0\bin \r\n$MiKTeXPath \r\n$GhostscriptPath
>  \r\n$ImageMagickPath\r\n$PythonPath\r\n$PerlPath"

Or, perhaps more simply:

  StrCpy $0
"$MiKTeXPath$\r$\n$GhostscriptPath$\r$\n$ImageMagickPath$\r$\n$PythonPath$\r$\n$PerlPath"
  ${StrNSISToIO} $0 $0

Note that ${StrNSISToIO} is part of StrUtils.nsh...

You don't want to manipulate (change) $GhostscriptPath et al, because
you're actually going to use them later...

-- 
Angus



Re: Installing Windows fonts

2005-06-15 Thread Johann Kellerman

> > Create one string that contains
> > the lang environment variable and just makes sure that is translated
for now.
> > That solves the language step in one go. You select your installation 
  language
> > and your environment variable is set according to that.
> 
> That is not possible as we have only six available installer languages. 
> That means an italian user must start the installer in english and can 
> later choose "Italiano".

I know there are only a couple of translated languages. What I propose is create
the other languages as nullsoft languages. For now the installer strings can be
in english until a concerned user post the correct translations. The only string
we can translate for now is the lang environment variable.

This means a user selects a language only once. If not translated yet, maybe
show a message that the installer is in english until we receive a contribution,
but at least lyx should be fine.

Regards, Johann






Re: Installing Windows fonts

2005-06-15 Thread Johann Kellerman

> > and the \t issue when you write to 
> >   !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" \
> >"$INSTDIR\bin \r\n$MiKTeXPath \r\n$GhostscriptPath
> > \r\n$ImageMagickPath\r\n$PythonPath\r\n$PerlPath"
> > you have to quote the paths.
> 
> What do you mean with the "\t issue" did I missed something? And what 
> should I quote? This is a string of a label and threrfore still in quotes.

Sorry for the confusion. It was discussed in an earlier post. If you write to
the installoptions ini file. you have to quote (or rather escape) \t \r \n in
the paths. else they get turned into spaces, newlines etc. According the the
abovementioned section you should have \\t for tab (located in path strings like
c:\texmf). They have the nessacery function in installoption(see below).

So after constructing and writing out the complete path variable to anther
variable, the one that you send to Angus's plugin. You should escape al the path
names:

Push $GhostscriptPath
Call Nsis2Io
Pop $GhostscriptPath
Push $INSTDIR
Call Nsis2Io
Pop $R0   ; dont mess with instdir
Push $MiKTeXPath
Call Nsis2Io
Pop $MiKTeXPath
Push $PerlPath
Call Nsis2Io
Pop $PerlPath
Push $ImageMagickPath
Call Nsis2Io
Pop $ImageMagickPath
Push $PythonPath
Call Nsis2Io
Pop $PythonPath
;and then only --> note the $R0 change
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" \
"$R0\bin \r\n$MiKTeXPath \r\n$GhostscriptPath
 \r\n$ImageMagickPath\r\n$PythonPath\r\n$PerlPath"


Haven't tested it but it should work (hopefully)

I will look into skipping a page. I no it is possible to skip standard pages
with _PRE and _POST macros, but I'll try to construct a small installoptions
case and pass it along


Regards, 
Johann







; Convert an NSIS string to a form suitable for use by InstallOptions
; Usage:
;   Push 
;   Call Nsis2Io
;   Pop 
Function Nsis2Io
  Exch $0 ; The source
  Push $1 ; The output
  Push $2 ; Temporary char
  StrCpy $1 "" ; Initialise the output
loop:
  StrCpy $2 $0 1 ; Get the next source char
  StrCmp $2 "" done ; Abort when none left
StrCpy $0 $0 "" 1 ; Remove it from the source
StrCmp $2 "\" "" +3 ; Back-slash?
  StrCpy $1 "$1\\"
  Goto loop
StrCmp $2 "$\r" "" +3 ; Carriage return?
  StrCpy $1 "$1\r"
  Goto loop
StrCmp $2 "$\n" "" +3 ; Line feed?
  StrCpy $1 "$1\n"
  Goto loop
StrCmp $2 "$\t" "" +3 ; Tab?
  StrCpy $1 "$1\t"
  Goto loop
StrCpy $1 "$1$2" ; Anything else
Goto loop
done:
  StrCpy $0 $1
  Pop $2
  Pop $1
  Exch $0
FunctionEnd





Re: Installing Windows fonts

2005-06-14 Thread Uwe Stöhr

Johann Kellerman schrieb:


For the languages I have the following suggestion. Include all the available
languages in Lyx as .nsh files in the installer.


I excluded the language material from the main script to LyXUtils.nsh. 
This is now the language database and makes the main script more concise.


I uploaded all scripts I use for my installer to

http://fkurth.de/uwest/LyX/Installer/Scripts/


Create one string that contains
the lang environment variable and just makes sure that is translated for now.
That solves the language step in one go. You select your installation language
and your environment variable is set according to that.


That is not possible as we have only six available installer languages. 
That means an italian user must start the installer in english and can 
later choose "Italiano".



All that really needs to be done is to update to Angus's newer plugin (to stop
installation while running configure)


This is done by Angus' lyx_path_prefix.dll. This feature is in now.

and the \t issue when you write to 
  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" \

   "$INSTDIR\bin \r\n$MiKTeXPath \r\n$GhostscriptPath
\r\n$ImageMagickPath\r\n$PythonPath\r\n$PerlPath"
you have to quote the paths.


What do you mean with the "\t issue" did I missed something? And what 
should I quote? This is a string of a label and threrfore still in quotes.


---

actual version:

http://fkurth.de/uwest/LyX/Installer/lyx_setup_136proposal-v14.exe

regards Uwe


Re: Installing Windows fonts

2005-06-14 Thread Uwe Stöhr

Johann Kellerman schrieb:


Everything seems fine. The summary of the page is nice for novice users, but I
would prefer a advanced button with a more detailed explanation. It just seems
wrong if it says it found everything.


I mean that the standard use doesn't want to be bothered with such 
special informations. But what is wrong to say everything is found?


I wanted to get rid of this installer page if all needed programs are 
found, but NSIS doesn't allow to create installer pages only under 
certain conditions. That's why this page appears always. If you have a 
slution, please tell me!


> will want to know where it found it (msys/cygwin issues) and all that 
> important for the rest is if it found a harddisk to install to.


All paths are displayed in the summary page (also the path to msys 
etc.). What else should I display? Btw. the aplication paths can also be 
found in LyX's preferences after the installation.



Had a quick look at the instalation script, the fonts seems quite complex
(4+files) compared to the 30 line solution i had.


I use only two: FontNameLyX.nsh and FontRegAdvLyX.nsh The others are 
only there for reference.
The problem was that I want to replace fonts with another version. I had 
also a small solution for the font installation but replacing fonts 
wasn't successful. My version didn't also not work under Win98.
Using the scripts has the advantage that possible error messages comes 
with translated strings and that it alows me to backup the replaced 
fonts. Backuped fonts will be reinstalled while unistalling the program. 
I used this feature in a previous version.



I don't quite understand the
issue between xft and bakoma


Use e.g. an integral sign with limits and you'll see the problem. The 
integral sign jumps up. There is also the problem that relation signs 
disappear if certain screen font resolutions are set in LyX's 
preferences. That's why mainly Ekkehardt Schlicht invested some time to 
create a font package that works in all situations.



For the languages I have the following suggestion. Include all the available
languages in Lyx as .nsh files in the installer. Create one string that contains
the lang environment variable and just makes sure that is translated for now.
That solves the language step in one go. You select your installation language
and your environment variable is set according to that.


I'll implement it.


All that really needs to be done is to update to Angus's newer plugin (to stop
installation while running configure) and the \t issue when you write to 
  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" \

   "$INSTDIR\bin \r\n$MiKTeXPath \r\n$GhostscriptPath
\r\n$ImageMagickPath\r\n$PythonPath\r\n$PerlPath"
you have to quote the paths. See "Get the input" in
http://nsis.sourceforge.net/Contrib/InstallOptions/Readme.html for a function to
do it.


I'll have a look and possibly some additional qestions.

---

There is a problem I can't solve:

When the installer hasn't found the needed program it should quit. But 
it should jump to the finish page (which has then a different text) and 
then quit by pressing the finish button. How can this be done?
I'm also not able to change the next-button text conditionally from 
"Next >" to e.g. "Finish >".


Many thanks for the feed back and the infos.
regards Uwe


Re: Installing Windows fonts

2005-06-14 Thread Johann Kellerman
Hi Uwe,

Everything seems fine. The summary of the page is nice for novice users, but I
would prefer a advanced button with a more detailed explanation. It just seems
wrong if it says it found everything... the people that know what everything is
will want to know where it found it (msys/cygwin issues) and all that important
for the rest is if it found a harddisk to install to. 

Had a quick look at the instalation script, the fonts seems quite complex
(4+files) compared to the 30 line solution i had. I don't quite understand the
issue between xft and bakoma, but thats probably an issue for a whole other
thread. Xft works, doesn't look that bad and if instant preview is on (which now
works out of the box) do you really need the prettier font with lots of
licensing issues to confuse your average user? Why would you even want to turn
off instant preview?

For the languages I have the following suggestion. Include all the available
languages in Lyx as .nsh files in the installer. Create one string that contains
the lang environment variable and just makes sure that is translated for now.
That solves the language step in one go. You select your installation language
and your environment variable is set according to that.

All that really needs to be done is to update to Angus's newer plugin (to stop
installation while running configure) and the \t issue when you write to 
  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" \
   "$INSTDIR\bin \r\n$MiKTeXPath \r\n$GhostscriptPath
\r\n$ImageMagickPath\r\n$PythonPath\r\n$PerlPath"
you have to quote the paths. See "Get the input" in
http://nsis.sourceforge.net/Contrib/InstallOptions/Readme.html for a function to
do it.

Regards, 
Johann





Re: Installing Windows fonts

2005-06-14 Thread Uwe Stöhr

I wrote:


(The source code is in the attached skript)


I forgot it, sorry. Now attached.

Uwe
; Lyx for Windows, NSIS v2 series installer script

; File LyXWinUtils.nsi
; This file is part of LyX, the document processor.
; http://www.lyx.org/
; Licence details can be found in the file COPYING or copy at
; http://www.lyx.org/about/license.php3

; Author Uwe Stöhr based on the work of Angus Leeming
; Full author contact details are available in file CREDITS or copy at
; http://www.lyx.org/about/credits.php

; This script requires NSIS 2.06 and above
; http://nsis.sourceforge.net/
;

; Do a Cyclic Redundancy Check to make sure the installer
; was not corrupted by the download.
CRCCheck force

; Make the installer as small as possible.
;SetCompressor lzma

;
; You should need to change only these macros...

!define PRODUCT_NAME "LyX"
!define PRODUCT_VERSION "1.3.6"
!define PRODUCT_LICENSE_FILE "F:\LyXPackage\License.txt"
!define PRODUCT_SOURCEDIR "F:\LyXPackage\LyX"
!define PRODUCT_EXE "$INSTDIR\bin\lyx.exe"
!define PRODUCT_EXT ".lyx"
!define PRODUCT_MIME_TYPE "application/lyx"
!define PRODUCT_UNINSTALL_EXE "$INSTDIR\uninstall.exe"

!define INSTALLER_EXE "lyx_setup_136small.exe"
!define INSTALLER_ICON "F:\LyXpackage\icons\lyx_32x32.ico"

; Replaced by HKLM or HKCU depending on SetShellVarContext.
!define PRODUCT_ROOT_KEY "SHCTX"

!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App 
Paths\lyx.exe"
!define PRODUCT_UNINST_KEY 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"

;
; Make some of the information above available to NSIS.

Name "${PRODUCT_NAME}"
OutFile "${INSTALLER_EXE}"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"

;
!include "MUI.nsh"
!include "LogicLib.nsh"
!include "StrFunc.nsh"
!include "SearchUtils.nsh"

; Grabbed from
; http://nsis.sourceforge.net/archive/viewpage.php?pageid=275
!include "is_user_admin.nsh"

; Grabbed from
; 
http://abiword.pchasm.org/source/cvs/abiword-cvs/abi/src/pkg/win/setup/NSISv2/abi_util_fileassoc.nsh
; Use the Abiword macros to help set up associations with the file extension.
; in the Registry.
!include "abi_util_fileassoc.nsh"

;Grabbed from
;http://nsis.sourceforge.net/archive/viewpage.php?pageid=400
;and modified for LyX (see FontRegAdv.diff)
;needed to install/deinstall fonts
!include FontRegAdvLyX.nsh

;Grabbed from
;http://vytautas.mine.nu/nsis.php
;and modified for LyX (see FontName.diff)
;necessary for the FontRegAdv.nsh library
!include "FontNameLyX.nsh"

;
; Variables

Var MiKTeXPath
Var PythonPath
Var DelPythonFiles
Var PerlPath
Var DelPerlFiles
Var GhostscriptPath
Var ImageMagickPath
Var PathPrefix

Var FileExists
Var Tmp
Var FontChoice
Var LangName
Var LangCode
Var Abort
Var CreateFileAssociations
Var CreateDesktopIcon
Var StartmenuFolder
Var ProductRootKey

;

; Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"

!define MUI_ABORTWARNING
!define MUI_ICON "${INSTALLER_ICON}"
!define MUI_UNICON "${INSTALLER_ICON}"

; Welcome page
!insertmacro MUI_PAGE_WELCOME

;Page custom DownloadMiKTeX DownloadMiKTeX_LeaveFunction
;Page custom DownloadGhostscript DownloadGhostscript_LeaveFunction
;Page custom DownloadImageMagick DownloadImageMagick_LeaveFunction

Page custom MissingPrograms MissingPrograms_LeaveFunction

; Show the license.
!insertmacro MUI_PAGE_LICENSE "${PRODUCT_LICENSE_FILE}"

; Specify the installation directory.
!insertmacro MUI_PAGE_DIRECTORY

; Specify LyX's menu language.
Page custom SelectLanguage SelectLanguage_LeaveFunction

; Show a summary.
Page custom SummariseDownloads SummariseDownloads_LeaveFunction

; Define which components to install.
!insertmacro MUI_PAGE_COMPONENTS

; Specify where to install program shortcuts.
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!insertmacro MUI_PAGE_STARTMENU ${PRODUCT_NAME} $StartmenuFolder

; Watch the components being installed.
!insertmacro MUI_PAGE_INSTFILES

!define MUI_FINISHPAGE_TEXT "$(FinishPageMessage)"
;To see LyX in the chosen language LyX must be started
;after the installer has finished.
;Also the finish-page appears before LyX's configuration is ready.
;Therefore I disabled this option.
;!define MUI_FINISHPAGE_RUN_TEXT "$(FinishPageRun)"
;!define MUI_FINISHPAGE_RUN "${PRODUCT_EXE}"
!insertmacro MUI_PAGE_FINISH

; The uninstaller.
!insertmacro MUI_UNPAGE_INSTFILES

;
; Languages

!insertmacro MUI_LANGUAGE "English" # first language is the default language
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE 

Re: Installing Windows fonts

2005-06-14 Thread Uwe Stöhr

Hello Angus, hello Johann,

Angus Leeming wrote:


Uwe, how does this strategy compare to yours?


Johann Kellerman wrote:


Attached is a nsi script to install/uninstall the required fonts. You
can easily change between xft-fonts and bakoma. (one line in script)


I need more lines as I let the user decide what to use.

Johann can you test my font install routine, that is built in the 
following installer:


http://fkurth.de/uwest/LyX/Installer/lyx_setup_136proposal.exe

(The source code is in the attached skript)
Here the description (taken from a previous message to the lyx-devel list):

--
The font installation should now work on XP, 2000, ME, and 98. I found 
some useful scripts in the NSIS forum but has to modyfy them to work 
with NSIS 2.06 and for special LyX purposes. I uploaded:


http://fkurth.de/uwest/LyX/Installer/lyx_setup_136smallAlwaysFonts-v13.exe

This version installs the fonts no matter if they are yet installed. 
This has the following advantage:


- Users which currently use LyX 1.3.5 and have installed the LaTeX-XFT 
fonts can benefit from the BaKoMa-fonts. They choose them in the 
installer and the XFT-fonts will be replaced.


- Users who have the BaKoMa-fonts installed probably don't have the 
wasy10.ttf installed. This was my fault as I forgot them in the font 
package when I announced it. (I fixed this two weeks ago.) These users 
also benefit from the "install always" method as the wasy-font is installed.

--

The same is implemented in my actual package. (plus a bugfix)
If you are interested in the complete skript repository, download it from:

http://fkurth.de/uwest/LyX/Installer/LyXPackage.rar

thanks and regards
Uwe