4 # create the PathPrefix
5 StrCpy $PathPrefix "$INSTDIR\bin"
6 ${if} $PythonPath != ""
7 StrCpy $PathPrefix "$PathPrefix;$PythonPath"
10 StrCpy $PathPrefix "$PathPrefix;$LatexPath"
12 ${if} $GhostscriptPath != ""
13 StrCpy $PathPrefix "$PathPrefix;$GhostscriptPath"
15 ${if} $ImageMagickPath != ""
16 StrCpy $PathPrefix "$PathPrefix;$ImageMagickPath"
19 StrCpy $PathPrefix "$PathPrefix;$PSVPath"
21 ${if} $EditorPath != ""
22 StrCpy $PathPrefix "$PathPrefix;$EditorPath"
24 ${if} $ImageEditorPath != ""
25 StrCpy $PathPrefix "$PathPrefix;$ImageEditorPath"
28 # Set a path prefix in lyxrc.dist
30 ${if} "$PathPrefix" != ""
31 Delete "$INSTDIR\Resources\lyxrc.dist"
32 FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" w
33 FileWrite $R1 '\path_prefix "$PathPrefix"$\r$\n'
36 MessageBox MB_OK|MB_ICONEXCLAMATION "$(ModifyingConfigureFailed)"
39 # Create a batch file to start LyX with the environment variables set
41 Delete "${PRODUCT_BAT}"
42 FileOpen $R1 "${PRODUCT_BAT}" w
43 FileWrite $R1 '@echo off$\r$\n\
44 SET LANG=$LangCode$\r$\n\
45 SET AIK_DATA_DIR=${AiksaurusDir}$\r$\n\
46 start "${PRODUCT_NAME}" "${LAUNCHER_EXE}" %*$\r$\n'
49 MessageBox MB_OK|MB_ICONEXCLAMATION "$(CreateCmdFilesFailed)"
51 # set the preferences file
52 # (having one preferences file that is modified to fit the needs is possible but not easy to maintain
53 # therefore simply delete the file that shouldn't be used)
54 # if not Acrobat or Adobe Reader is used
55 ${if} $Acrobat == "None" # no special PDF viewer is used
56 Rename "$INSTDIR\Resources\preferencesGSview" "$INSTDIR\Resources\preferences"
57 Delete "$INSTDIR\Resources\preferencesAcro"
59 # if Acrobat or Adobe Reader is used
60 ${if} $Acrobat == "Yes" # used for Acrobat / Adobe Reader
61 Rename "$INSTDIR\Resources\preferencesAcro" "$INSTDIR\Resources\preferences"
62 Delete "$INSTDIR\Resources\preferencesGSview"
66 ${if} $CreateFileAssociations == "true"
67 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
69 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey"
70 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
71 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "${PRODUCT_UNINSTALL_EXE}"
72 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "${PRODUCT_EXE}"
73 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
74 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
75 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${PRODUCT_INFO_URL}"
76 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_ABOUT_URL}"
77 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "Publisher" "LyX Team"
78 WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "HelpLink" "${PRODUCT_HELP_LINK}"
79 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" 0x00000001
80 WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" 0x00000001
82 # create start menu entry
83 SetOutPath "$INSTDIR\bin"
84 CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
85 CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
87 CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "${PRODUCT_UNINSTALL_EXE}"
90 ${if} $CreateDesktopIcon == "true"
91 SetOutPath "$INSTDIR\bin"
92 CreateShortCut "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
95 # register the extension .lyx
96 ${if} $CreateFileAssociations == "true"
97 # write informations about file type
98 WriteRegStr SHCTX "Software\Classes\${PRODUCT_REGNAME}" "" "${PRODUCT_NAME} Document"
99 WriteRegStr SHCTX "Software\Classes\${PRODUCT_REGNAME}\DefaultIcon" "" "${PRODUCT_EXE}"
100 WriteRegStr SHCTX "Software\Classes\${PRODUCT_REGNAME}\Shell\open\command" "" '"${PRODUCT_BAT}" "%1"'
101 # write informations about file extensions
102 WriteRegStr SHCTX "Software\Classes\${PRODUCT_EXT}" "" "${PRODUCT_REGNAME}"
103 WriteRegStr SHCTX "Software\Classes\${PRODUCT_EXT}" "Content Type" "${PRODUCT_MIME_TYPE}"
105 System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
108 # create the LyX Application Data folder for all users
109 # this folder is automatically created by LyX when it is first started but we want to start LyX with a specific session file,
110 # so we create this folder before LyX starts and copy there the session file
111 Call CreateAppPathSub # function from LyXUtils.nsh
113 # delete unnecessary files
114 ${if} $DelPythonFiles == "True"
115 Delete $INSTDIR\bin\python.exe
116 Delete $INSTDIR\bin\python25.dll
117 Delete $INSTDIR\bin\Python-License.txt
118 RMDir /r $INSTDIR\bin\Lib
119 RMDir /r $INSTDIR\bin\DLLs
121 RMDir /r $INSTDIR\external
123 # create a bat-file to start configure in a console window so that the user see the progress
124 # of the configuration and to have a signal when the configuration is ready to start LyX
125 # this is important when LyX is installed together with MiKTeX or when LyX is installed for the first
126 # time on a computer, because the installation of missing LaTeX-files required by LyX could last minutes
127 # a batch file is needed because simply calling
128 # ExecWait '"$PythonPath\python.exe" "$INSTDIR\Resources\configure.py"'
129 # creates the config files in $PythonPath
130 ${if} $PythonPath == ""
131 StrCpy $PythonPath "$INSTDIR\bin"
133 StrCpy $1 $INSTDIR 2 # get drive letter
134 FileOpen $R1 "$INSTDIR\Resources\configLyX.bat" w
135 FileWrite $R1 '$1$\r$\n\
136 cd $INSTDIR\Resources\$\r$\n\
137 "$PythonPath\python.exe" configure.py'