]> git.lyx.org Git - features.git/commitdiff
Win installer: code review
authorUwe Stöhr <uwestoehr@lyx.org>
Wed, 6 Dec 2017 14:36:01 +0000 (15:36 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Wed, 6 Dec 2017 14:36:01 +0000 (15:36 +0100)
- use https in URLs
- remove some unused code
- use variables if possible

development/Win32/packaging/installer/include/declarations.nsh
development/Win32/packaging/installer/include/gui.nsh
development/Win32/packaging/installer/include/init.nsh
development/Win32/packaging/installer/settings.nsh
development/Win32/packaging/installer/setup/configure.nsh
development/Win32/packaging/installer/setup/uninstall.nsh

index 1720eb0fe61c80632731438f248bfe8c015f97f3..82d428cea6ca811434ae923e6e8219df1ff66fd2 100644 (file)
@@ -44,7 +44,7 @@ Configuration of LyX installer
 
 !define APP_NAME "LyX"
 !define APP_VERSION_NUMBER "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION}.${APP_VERSION_BUILD}"
-# for the proposed install folder we use the scheme "LyX 2.1" while we need for the registry the scheme "LyX 2.1.4"
+# for the proposed install folder we use the scheme "LyX 2.2" while we need for the registry the scheme "LyX 2.1.4"
 # to check if it is exactly this version (to support side by side installations)
 !define APP_SERIES_NAME "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}"
 !define APP_SERIES_KEY "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}"
@@ -53,11 +53,11 @@ Configuration of LyX installer
 !define APP_DIR "${APP_NAME} ${APP_SERIES_NAME}"
 !define APP_DIR_USERDATA "${APP_NAME}${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}"
 !define APP_INFO "${APP_NAME} - The Document Processor"
-!define APP_WEBPAGE "http://www.lyx.org/"
+!define APP_WEBPAGE "https://www.lyx.org/"
 !define APP_WEBPAGE_INFO "${APP_NAME} Website"
-!define APP_WIKI "http://wiki.lyx.org"
+!define APP_WIKI "https://wiki.lyx.org"
 !define APP_WIKI_INFO "${APP_NAME} Wiki"
-!define APP_COPYRIGHT "LyX is Copyright © 1995 by Matthias Ettrich, 1995-${COPYRIGHT_YEAR} by the LyX Team"
+!define APP_COPYRIGHT "${APP_NAME} is Copyright © 1995 by Matthias Ettrich, 1995-${COPYRIGHT_YEAR} by the ${APP_NAME} Team"
 !if ${SETUPTYPE} == STANDARD
   !define APP_SETUPTYPE "Standard"
 !else if ${SETUPTYPE} == BUNDLE
index b5fdb441e4d4fea6cc64dec145dd8955c000fb9e..b077677f424f18f1ff7816949558aad3a3240b84 100644 (file)
@@ -47,7 +47,7 @@ BrandingText " "
 
 # Specify where to install program shortcuts.
 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
-!define MUI_STARTMENUPAGE_DEFAULTFOLDER "LyX ${APP_SERIES_NAME}"
+!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${APP_NAME} ${APP_SERIES_NAME}"
 !insertmacro MUI_PAGE_STARTMENU ${APP_NAME} $StartmenuFolder
 
 !if ${SETUPTYPE} != BUNDLE
@@ -70,7 +70,7 @@ BrandingText " "
 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION StartLyX
 !define MUI_FINISHPAGE_SHOWREADME_TEXT $(FinishPageRun)
 !define MUI_FINISHPAGE_LINK $(TEXT_FINISH_WEBSITE)
-!define MUI_FINISHPAGE_LINK_LOCATION "http://www.lyx.org/"
+!define MUI_FINISHPAGE_LINK_LOCATION "https://www.lyx.org/"
 #!define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckDesktopShortcut
 !insertmacro MUI_PAGE_FINISH
 
@@ -97,6 +97,6 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${APP_NAME} ${APP_VERSIO
 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APP_INFO}"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "${APP_COPYRIGHT}"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "LyX Team"
-# Fixme: LyX should register the name LyX as trademark
+VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${APP_NAME} Team"
+# Fixme: LyX should register the name "LyX" as trademark
 VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" ""
index bc85927bc75e3ce80730c92fcef7f3c869df8f32..661a70b3f6364b4c805a35baf511543ae064ae07 100644 (file)
@@ -620,7 +620,7 @@ Function .onInit
   !endif
   
   # Check that LyX is not currently running
-  FindProcDLL::FindProc "lyx.exe"
+  FindProcDLL::FindProc "${BIN_LYX}"
   ${if} $R0 == "1"
    MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" /SD IDOK
    Abort
@@ -650,7 +650,7 @@ Function .onInit
    # because he won't have a chance to deny this
    StrCpy $4 $0 -10 # remove '\bin\lyx,0'
    # (for FileCheck the variables $0 and $1 cannot be used)
-   !insertmacro FileCheck $5 "Uninstall-LyX.exe" "$4" # macro from LyXUtils.nsh
+   !insertmacro FileCheck $5 "Uninstall-${APP_NAME}.exe" "$4" # macro from LyXUtils.nsh
    ${if} $5 == "False"
     Goto ForceInstallation
    ${endif}
@@ -1429,7 +1429,7 @@ Function un.onInit
   !insertmacro MULTIUSER_UNINIT
 
   # Check that LyX is not currently running
-  FindProcDLL::FindProc "lyx.exe"
+  FindProcDLL::FindProc "${BIN_LYX}"
   ${if} $R0 == "1"
    MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" /SD IDOK
    Abort
index 7d7ee91f363e4f083779ada03fe247af42f653d8..801def163e4f27d2e53ef104f20236d8569fd59d 100644 (file)
@@ -26,10 +26,10 @@ These typically need to be modified for each LyX release
 # Typical names for the release are "LyX-211-Installer-1.exe" etc.
 
 !ifndef ExeFile
-  !define ExeFile "LyX-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}-Installer-${APP_VERSION_BUILD}.exe"
+  !define ExeFile "${APP_NAME}-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}-Installer-${APP_VERSION_BUILD}.exe"
 !endif
 !ifndef BundleExeFile
-  !define BundleExeFile "LyX-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}-Bundle-${APP_VERSION_BUILD}.exe"
+  !define BundleExeFile "${APP_NAME}-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}-Bundle-${APP_VERSION_BUILD}.exe"
 !endif
 
 #--------------------------------
index 62c944eebaf89d5b33de75a50afe3df9b4124352..7a4aa7a983f324a3130c559646f4128381067c00 100644 (file)
@@ -48,9 +48,9 @@ Section -InstallData
   WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayVersion" "${APP_VERSION}"
   WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayIcon" "$INSTDIR\bin\lyx,0"
   WriteRegStr SHCTX ${APP_UNINST_KEY} "URLUpdateInfo" "${APP_WEBPAGE}"
-  WriteRegStr SHCTX ${APP_UNINST_KEY} "URLInfoAbout" "http://www.lyx.org/AboutLyX"
-  WriteRegStr SHCTX ${APP_UNINST_KEY} "Publisher" "LyX Team"
-  WriteRegStr SHCTX ${APP_UNINST_KEY} "HelpLink" "http://www.lyx.org/MailingLists"
+  WriteRegStr SHCTX ${APP_UNINST_KEY} "URLInfoAbout" "https://www.lyx.org/AboutLyX"
+  WriteRegStr SHCTX ${APP_UNINST_KEY} "Publisher" "${APP_NAME} Team"
+  WriteRegStr SHCTX ${APP_UNINST_KEY} "HelpLink" "https://www.lyx.org/MailingLists"
   WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoModify" 0x00000001
   WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoRepair" 0x00000001
   WriteRegStr SHCTX ${APP_UNINST_KEY} "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
@@ -267,34 +267,13 @@ Section -ConfigureScript
 SectionEnd
 
 #--------------------------------
-# Desktop shortcut
+#
 
 Function StartLyX
 
   # run LyX in a command line window to give the users feedback about
   # the time consuming LaTeX package installation
   
-  #Exec 'cmd /K " "$INSTDIR\bin\lyx.exe""'
   Exec "$INSTDIR\${APP_RUN}"
 
 FunctionEnd
-
-/*Function CheckDesktopShortcut
-
-  # Enable desktop icon creation when there is an icon already
-  # Old shortcuts need to be updated
-  
-  ${If} ${FileExists} "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
-    ${NSD_SetState} $mui.FinishPage.ShowReadme ${BST_CHECKED}
-  ${EndIf}
-
-FunctionEnd
-
-Function CreateDesktopShortcut
-
-  # Desktop icon creation is an option on the finish page
-  SetOutPath "$INSTDIR\bin"
-  CreateShortCut "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"
-
-FunctionEnd*/
-
index 35e4df13217829349b5acb63fc5e935e22e1ba61..8767c6e0fafca91b09e35daac996aba2ece0638f 100644 (file)
@@ -63,7 +63,7 @@ Section "un.LyX" un.SecUnProgramFiles
    ${endif}
   ${endif}
   ${if} $MultiUser.Privileges == "Admin"
-   DeleteRegKey HKCR "LyX.Document"
+   DeleteRegKey HKCR "${APP_NAME}.Document"
   ${endif}
 
   # Uninstaller itself
@@ -77,9 +77,9 @@ Section "un.LyX" un.SecUnProgramFiles
   DeleteRegKey SHCTX "${APP_REGKEY_SETUP}"
   DeleteRegKey SHCTX "${APP_REGKEY}"
   DeleteRegKey SHCTX "${APP_UNINST_KEY}"
-  DeleteRegKey HKCR "Applications\lyx.exe"
-  DeleteRegValue HKCR "LyX.Document\Shell\open\command" ""
-  DeleteRegValue HKCR "LyX.Document\DefaultIcon" ""
+  DeleteRegKey HKCR "Applications\${BIN_LYX}"
+  DeleteRegValue HKCR "${APP_NAME}.Document\Shell\open\command" ""
+  DeleteRegValue HKCR "${APP_NAME}.Document\DefaultIcon" ""
   
   # File associations
   ReadRegStr $FileAssociation SHELL_CONTEXT "Software\Classes\${APP_EXT}" ""
@@ -115,7 +115,7 @@ Section /o "un.$(UnLyXPreferencesTitle)" un.SecUnPreferences
  StrCpy $AppSubfolder ${APP_DIR_USERDATA}
  Call un.DelAppPathSub # function from LyXUtils.nsh
  # remove registry settings
- DeleteRegKey HKCU "Software\LyX\LyX${APP_SERIES_NAME}"
+ DeleteRegKey HKCU "Software\${APP_NAME}\${APP_NAME}${APP_SERIES_NAME}"
   
 SectionEnd