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 "Spanish"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Dutch"

!include "lyx_languages\english.nsh"
!include "lyx_languages\danish.nsh"
!include "lyx_languages\dutch.nsh"
!include "lyx_languages\french.nsh"
!include "lyx_languages\german.nsh"
!include "lyx_languages\spanish.nsh"

LicenseData "$(LyXLicenseData)"

;--------------------------------
; Reserve Files

; These files should be inserted before other files in the data block
; Keep these lines before any File command
; Only for solid compression (by default, solid compression
; is enabled for BZIP2 and LZMA)
ReserveFile "ioDownload.ini"
ReserveFile "ioSummary.ini"
!insertmacro MUI_RESERVEFILE_LANGDLL
ReserveFile "LanguageSet.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

;--------------------------------

Section "!${PRODUCT_NAME}" SecCore
  SectionIn RO
SectionEnd

Section /o "$(SecAllUsersTitle)" SecAllUsers
  SetShellVarContext all
  StrCpy $ProductRootKey "HKLM"
; Script option for WriteEnvStr.nsh
  !define ALL_USERS
SectionEnd

;Grabbed from
;http://nsis.sourceforge.net/archive/viewpage.php?pageid=137
;to write environment variables.
!include "WriteEnvStr.nsh"

Section "$(SecFileAssocTitle)" SecFileAssoc
  StrCpy $CreateFileAssociations "true"
SectionEnd

Section "$(SecDesktopTitle)" SecDesktop
  StrCpy $CreateDesktopIcon "true"
SectionEnd

; The '-' makes the section invisible.
; Sections are entered in order, so the settings above are all
; available to SecInstallation
Section "-Installation actions" SecInstallation
  SetOverwrite off
  SetOutPath "$INSTDIR"
  File /r "${PRODUCT_SOURCEDIR}\Resources"
  File /r "${PRODUCT_SOURCEDIR}\bin"
  File /r "${PRODUCT_SOURCEDIR}\etc"
  File /r "${PRODUCT_SOURCEDIR}\BaKoMaFonts"
  File /r "${PRODUCT_SOURCEDIR}\LaTeX-XFTFonts"

  ${if} "$PathPrefix" != ""
    lyx_path_prefix::set_path_prefix "$INSTDIR\Resources\lyx\configure" 
"$PathPrefix"
    Pop $0
    ${if} $0 != 0
      MessageBox MB_OK "$(ModifyingConfigureFailed)"
    ${endif}
    lyx_path_prefix::run_configure "$INSTDIR\Resources\lyx\configure" 
"$PathPrefix"
    Pop $0
    ${if} $0 != 0
      MessageBox MB_OK "$(RunConfigureFailed)"
    ${endif}
  ${endif}

  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "RootKey" 
"$ProductRootKey"
  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" 
"$(^Name)"
  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" 
"${PRODUCT_UNINSTALL_EXE}"
  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" 
"${PRODUCT_EXE}"
  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" 
"${PRODUCT_VERSION}"
  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu" 
"$SMPROGRAMS\$StartmenuFolder"

  CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
  CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" 
"${PRODUCT_EXE}"
  CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" 
"${PRODUCT_UNINSTALL_EXE}"

  ${if} $CreateDesktopIcon == "true"
    CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "${PRODUCT_EXE}"
  ${endif}

  ${if} $CreateFileAssociations == "true"
    ${CreateApplicationAssociation} \
      "${PRODUCT_NAME}" \
      "${PRODUCT_NAME}" \
      "${PRODUCT_NAME} Document" \
      "${PRODUCT_EXE},1" \
      "${PRODUCT_EXE}"

    ${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" 
"${PRODUCT_MIME_TYPE}"
  ${endif}

  ;install the fonts

  ${if} $ProductRootKey == "HKLM"

   StrCpy $FONT_DIR $FONTS
   ${if} $FontChoice == "BaKoMa"
    StrCpy $FontDir "$INSTDIR\BaKoMaFonts"
   ${endif}
   ${if} $FontChoice == "XFT"
    StrCpy $FontDir "$INSTDIR\LaTeX-XFTFonts"
   ${endif}
   ${if} $FileExists == "True"
    !insertmacro RemoveTTF 'cmex10.ttf'
    !insertmacro RemoveTTF 'cmr10.ttf'
    !insertmacro RemoveTTF 'cmmi10.ttf'
    !insertmacro RemoveTTF 'cmsy10.ttf'
    !insertmacro RemoveTTF 'msam10.ttf'
    !insertmacro RemoveTTF 'msbm10.ttf'
    !insertmacro RemoveTTF 'wasy10.ttf'
    SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
   ${endif}
   !insertmacro InstallTTF "cmex10.ttf"
   !insertmacro InstallTTF 'cmr10.ttf'
   !insertmacro InstallTTF 'cmmi10.ttf'
   !insertmacro InstallTTF 'cmsy10.ttf'
   !insertmacro InstallTTF 'msam10.ttf'
   !insertmacro InstallTTF 'msbm10.ttf'
   !insertmacro InstallTTF 'wasy10.ttf'
   SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000

  ${endif}
 
  ;set the LANG environment variable
  Push "LANG"
  Push $LangCode
  Call WriteEnvStr

  ;delete unnecessary files
  ${if} $DelPythonFiles == "True"
   Delete $INSTDIR\bin\python.exe
   Delete $INSTDIR\bin\python24.dll
   RMDir /r $INSTDIR\bin\Lib
  ${endif}
  ${if} $DelPerlFiles == "True"
   Delete $INSTDIR\bin\perl.exe
   Delete $INSTDIR\bin\perl58.dll
  ${endif}

  WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
SectionEnd

; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecAllUsers} "$(SecAllUsersDescription)"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
!insertmacro MUI_FUNCTION_DESCRIPTION_END

;--------------------------------

!define MUI_LANGDLL_ALWAYSSHOW

; This hook function is called internally by NSIS on installer startup
Function .onInit
  
  !insertmacro MUI_LANGDLL_DISPLAY
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioDownload.ini"
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioSummary.ini"
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "LanguageSet.ini"
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "LanguageSetNoFont.ini"
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT MissingProgs.ini

  ; Default settings
  ; These can be reset to "all" in section SecAllUsers.
  SetShellVarContext current
  StrCpy $ProductRootKey "HKCU"

  ; This can be reset to "true" in section SecDesktop.
  StrCpy $CreateDesktopIcon "false"
  StrCpy $CreateFileAssociations "false"

  ; If the user does *not* have administrator privileges,
  ; then make section SecAllUsers readonly.
  Call IsUserAdmin
  Pop $0
  ${if} $0 == "true"
    !define ENABLE 0x00000001
    SectionGetFlags ${SecAllUsers} $0
    IntOp $0 $0 | ${ENABLE}
    SectionSetFlags ${SecAllUsers} $0
    !undef ENABLE
  ${else}
    !define READ_ONLY 0x00000010
    SectionGetFlags ${SecAllUsers} $0
    IntOp $0 $0 | ${READ_ONLY}
    SectionSetFlags ${SecAllUsers} $0
    !undef READ_ONLY
  ${endif}

  ClearErrors
FunctionEnd

;--------------------------------

Function MissingPrograms

  ;test if MiKTeX is installed
  ReadRegStr $MiKTeXPath HKLM "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" \
                              "Install Root"
  ${if} $MiKTeXPath != ""
   StrCpy $MiKTeXPath "$MiKTeXPath\miktex\bin"
  ${endif}

  ;test if Ghostscript is installed
  EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
  ${if} $1 != ""
   StrCpy $0 "Software\AFPL Ghostscript\$1"
   ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
   ${if} $GhostscriptPath != ""
    StrCpy $GhostscriptPath "$GhostscriptPath" -12
   ${endif}
  ${else}
    StrCpy $GhostscriptPath ""
  ${endif}

  ;test if Imagemagick is installed
  ReadRegStr $ImageMagickPath HKLM "Software\ImageMagick\Current" "BinPath"

  ;test if Python is installed
  StrCpy $DelPythonFiles ""
  ReadRegStr $PythonPath HKLM "Software\Microsoft\Windows\CurrentVersion\App 
Paths\Python.exe" ""
  ${if} $PythonPath != ""
   StrCpy $PythonPath "$PythonPath" -11
   StrCpy $DelPythonFiles "True"
  ${endif}

  ;test if Perl is installed
  StrCpy $DelPerlFiles ""
  ReadRegStr $PerlPath HKLM "Software\Perl" "BinDir"
  ${if} $PerlPath != ""
   StrCpy $PerlPath "$PerlPath" -9
   StrCpy $DelPerlFiles "True"
  ${endif}

  ;generate the installer page
  StrCpy $Abort ""

  ${if} $MiKTeXPath == ""
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field 5" "Text" \ 
                "Program: MiKTeX\r\nDescription: The LaTeX distribution"
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field $3" "State" 
\ 
                "http://www.miktex.org/setup.html";
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field $3" "Text" \ 
                "Install MiKTeX"
   StrCpy $Abort "True"
  ${endif}

  ${if} $GhostscriptPath == ""
   ${if} $MiKTeXPath == ""
    StrCpy $2 "6"
   ${else}
    StrCpy $2 "5"
   ${endif}
   IntOp $3 $2 - 3
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field $2" "Text" \ 
                "Program: Ghostscript\r\nDescription: Interpreter for PDF, EPS, 
and PS files"
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field $3" "State" 
\ 
                "http://www.cs.wisc.edu/~ghost/doc/AFPL/index.htm";
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field $3" "Text" \ 
                "Install Ghostscript"
    StrCpy $Abort "True"
  ${endif}

  ${if} $ImageMagickPath == ""
   StrCpy $2 ""
   ${if} $MiKTeXPath == ""
   ${andif} $GhostscriptPath == ""
    StrCpy $2 "7"
   ${else}
    StrCpy $2 "1"
   ${endif}
   ${if} $MiKTeXPath == ""
   ${andif} $2 = 1
    StrCpy $2 "6"
   ${else}
    StrCpy $2 "5"
   ${endif}
   IntOp $3 $2 - 3
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field $2" "Text" \ 
                "Program: ImageMagick\r\nDescription: Converter for image files"
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field $3" "State" 
\ 
                "http://www.imagemagick.org/script/binary-releases.php";
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field $3" "Text" \ 
                "Install ImageMagick"
    StrCpy $Abort "True"
  ${endif}

  !insertmacro MUI_HEADER_TEXT "Check for needed programs" ""

  ${if} $Abort != "True"
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field 6" "Text" \
                "All needed programs found.\r\nPlease continue."
   !insertmacro MUI_INSTALLOPTIONS_WRITE "MissingProgs.ini" "Field 1" "Text" ""
  ${endif}

  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "MissingProgs.ini"

FunctionEnd

Function MissingPrograms_LeaveFunction
 ${if} $Abort == "True"
  Quit
 ${endif}
FunctionEnd

;--------------------------------


Function SelectLanguage

  StrCpy $LangName ""

  ${if} $Language = 1030
   !insertmacro MUI_INSTALLOPTIONS_WRITE "LanguageSet.ini" "Field 2" "State" 
"Dansk"
  ${endif}

  ${if} $Language = 1031
   !insertmacro MUI_INSTALLOPTIONS_WRITE "LanguageSet.ini" "Field 2" "State" 
"Deutsch"
  ${endif}

  ${if} $Language = 1033
   !insertmacro MUI_INSTALLOPTIONS_WRITE "LanguageSet.ini" "Field 2" "State" 
"English"
  ${endif}

  ${if} $Language = 1034
   !insertmacro MUI_INSTALLOPTIONS_WRITE "LanguageSet.ini" "Field 2" "State" 
"Espagñol"
  ${endif}

  ${if} $Language = 1036
   !insertmacro MUI_INSTALLOPTIONS_WRITE "LanguageSet.ini" "Field 2" "State" 
"Français"
  ${endif}

  ${if} $Language = 1043
   !insertmacro MUI_INSTALLOPTIONS_WRITE "LanguageSet.ini" "Field 2" "State" 
"Nederlands"
  ${endif}

  ;check if the fonts are already installed
  !insertmacro FileCheck $FileExists "cmex10.ttf" "$Fonts"

  !insertmacro MUI_HEADER_TEXT "Selection of LyX's" "menu language and math 
fonts"
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "LanguageSet.ini"

FunctionEnd

Function SelectLanguage_LeaveFunction

  StrCpy $FontChoice ""

  StrCpy $Tmp "0"
  !insertmacro MUI_INSTALLOPTIONS_Read $Tmp "LanguageSet.ini" "Field 4" "State"
  ${if} $Tmp = "1"
   StrCpy $FontChoice "BaKoMa"
  ${Else}
   StrCpy $FontChoice "XFT"
  ${endif}

  !insertmacro MUI_INSTALLOPTIONS_READ $LangName "LanguageSet.ini" "Field 2" 
"State"
  
  StrCpy $LangCode ""

  ${if} $LangName == "Dansk"
   StrCpy $LangCode "da_DK"
  ${endif}

  ${if} $LangName == "Deutsch"
   StrCpy $LangCode "de_DE"
  ${endif}

  ${if} $LangName == "English"
   StrCpy $LangCode "en_EN"
  ${endif}

  ${if} $LangName == "Espagñol"
   StrCpy $LangCode "es_ES"
  ${endif}

  ${if} $LangName == "Euskara"
   StrCpy $LangCode "eu_EU"
  ${endif}

  ${if} $LangName == "Français"
   StrCpy $LangCode "fr_FR"
  ${endif}

  ${if} $LangName == "Italiano"
   StrCpy $LangCode "it_IT"
  ${endif}

  ${if} $LangName == "Nederlands"
   StrCpy $LangCode "nl_NL"
  ${endif}

  ${if} $LangName == "Norsk"
   StrCpy $LangCode "no_NO"
  ${endif}

  ${if} $LangName == "Nynorsk"
   StrCpy $LangCode "no_NY"
  ${endif}

  ${if} $LangName == "Polski"
   StrCpy $LangCode "pl_PL"
  ${endif}

  ${if} $LangName == "Româna"
   StrCpy $LangCode "ro_RO"
  ${endif}

  ${if} $LangName == "Russian"
   StrCpy $LangCode "ru_RU"
  ${endif}

  ${if} $LangName == "Slovencina"
   StrCpy $LangCode "sk_SK"
  ${endif}

  ${if} $LangName == "Slovenšcina"
   StrCpy $LangCode "sl_SI"
  ${endif}

  ${if} $LangName == "Suomi"
   StrCpy $LangCode "fi_FI"
  ${endif}

  ${if} $LangName == "Türkçe"
   StrCpy $LangCode "tr_TR"
  ${endif}
  
FunctionEnd

;--------------------------------

Function SummariseDownloads

  StrCpy $PathPrefix "$INSTDIR\bin"

  ${if} $PythonPath != ""
    StrCpy $PathPrefix "$PathPrefix;$PythonPath"
  ${endif}

  ${if} $MiKTeXPath != ""
    StrCpy $PathPrefix "$PathPrefix;$MiKTeXPath"
  ${endif}

  ${if} $PerlPath != ""
    StrCpy $PathPrefix "$PathPrefix;$PerlPath"
  ${endif}

  ${if} $GhostscriptPath != ""
    StrCpy $PathPrefix "$PathPrefix;$GhostscriptPath"
  ${endif}

  ${if} $ImageMagickPath != ""
    StrCpy $PathPrefix "$PathPrefix;$ImageMagickPath"
  ${endif}

  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 1" "Text" \
               "$(SummaryPathPrefix)"
  !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"
  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 3" "Text" \
               "LyX's menus will be in $LangName. \r\nTherefore the following 
environment variable is set:"
  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 4" "Text" \
               "LANG=$LangCode"

  !insertmacro MUI_HEADER_TEXT "$(SummaryTitle)" ""
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioSummary.ini"
FunctionEnd

Function SummariseDownloads_LeaveFunction
 
FunctionEnd

;--------------------------------
; The Uninstaller

Function un.onInit

  !insertmacro MUI_UNGETLANGUAGE

  ; Ascertain whether the user has sufficient privileges to uninstall.
  SetShellVarContext current

  ReadRegStr $0 HKCU "${PRODUCT_UNINST_KEY}" "RootKey"
  ${if} $0 == ""
    ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "RootKey"
    ${if} $0 == ""
      MessageBox MB_OK "$(UnNotInRegistryLabel)"
    ${endif}
  ${endif}

  ${if} $0 == "HKLM"
    Call un.IsUserAdmin
    Pop $0
    ${if} $0 == "true"
      SetShellVarContext all
    ${else}
      MessageBox MB_OK "$(UnNotAdminLabel)"
      Abort
    ${endif}
  ${endif}

  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" 
IDYES +2
  Abort
FunctionEnd


Function un.onUninstSuccess
  HideWindow
  MessageBox MB_ICONINFORMATION|MB_OK "$(UnRemoveSuccessLabel)"
FunctionEnd


Section Uninstall

 ;remove the LANG environment variable
  Push "LANG"
  Call un.DeleteEnvStr

  RMDir /r $INSTDIR

  ReadRegStr $0 ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu"
  RMDir /r "$0"

  Delete "$DESKTOP\${PRODUCT_NAME}.lnk"

  DeleteRegKey "HKCU" "${PRODUCT_UNINST_KEY}\Installer Language"
  DeleteRegKey ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"

  ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"

  ;Uninstall the installed math fonts
  StrCpy $FONT_DIR $FONTS
  !insertmacro UnRemoveTTF 'cmex10.ttf'
  !insertmacro UnRemoveTTF 'cmr10.ttf'
  !insertmacro UnRemoveTTF 'cmmi10.ttf'
  !insertmacro UnRemoveTTF 'cmsy10.ttf'
  !insertmacro UnRemoveTTF 'msam10.ttf'
  !insertmacro UnRemoveTTF 'msbm10.ttf'
  !insertmacro UnRemoveTTF 'wasy10.ttf'
   SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000

  SetAutoClose true
SectionEnd

; eof

Reply via email to