From: Soeren Apel Date: Sun, 28 Oct 2018 22:11:52 +0000 (+0100) Subject: Installer: Add links to manual X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a53b8efe3024859ff691b288833820985b032522;p=pulseview.git Installer: Add links to manual --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 64538f5b..dc642c4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,12 @@ if(NOT PV_TAG_VERSION_STRING) string(SUBSTRING "${PV_HASH}" 0 7 PV_SHORTHASH) set(PV_VERSION_STRING "${PV_VERSION_STRING}-git-${PV_SHORTHASH}") endif() + + # Non-tagged releases use the unstable manual + set(PV_MANUAL_VERSION "unstable") +else() + # Tagged releases use a fixed manual version + set(PV_MANUAL_VERSION ${PV_VERSION_STRING}) endif() if(PV_VERSION_STRING MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-[-0-9a-z]*)?$") diff --git a/contrib/pulseview_cross.nsi.in b/contrib/pulseview_cross.nsi.in index 13fd3180..fdcdf49e 100644 --- a/contrib/pulseview_cross.nsi.in +++ b/contrib/pulseview_cross.nsi.in @@ -81,7 +81,7 @@ RequestExecutionLevel admin !define SHCNF_IDLIST 0 -# --- Functions --------------------------------------------------------------- +# --- Functions/Macros -------------------------------------------------------- Function register_sr_files ${registerExtension} "$INSTDIR\pulseview.exe" ".sr" "sigrok session file" @@ -90,6 +90,12 @@ Function register_sr_files System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)' FunctionEnd +# Inspired by http://nsis.sourceforge.net/Create_Internet_Shorcuts_during_installation +!Macro "CreateURL" "URLFile" "URLSite" "URLDesc" + WriteINIStr "$INSTDIR\${URLFile}.URL" "InternetShortcut" "URL" "${URLSite}" + CreateShortCut "$SMPROGRAMS\sigrok\PulseView\${URLFile}.lnk" "$INSTDIR\${URLFile}.url" "" \ + "$INSTDIR\pulseview.exe" 0 "SW_SHOWNORMAL" "" "${URLDesc}" +!MacroEnd # --- MUI pages --------------------------------------------------------------- @@ -198,6 +204,10 @@ Section "PulseView (required)" Section1 "$INSTDIR\zadig_xp.exe" "" "$INSTDIR\zadig_xp.exe" 0 \ SW_SHOWNORMAL "" "Zadig (PulseView, Win XP)" + # Create shortcuts to the HTML and PDF manuals, respectively. + !InsertMacro "CreateURL" "PulseView HTML manual" "https://sigrok.org/doc/pulseview/@PV_MANUAL_VERSION@/manual.html" "PulseView HTML manual" + !InsertMacro "CreateURL" "PulseView PDF manual" "https://sigrok.org/doc/pulseview/@PV_MANUAL_VERSION@/manual.pdf" "PulseView PDF manual" + # Create registry keys for "Add/remove programs" in the control panel. WriteRegStr HKLM "${REGSTR}" "DisplayName" "PulseView" WriteRegStr HKLM "${REGSTR}" "UninstallString" \ @@ -273,6 +283,10 @@ Section "Uninstall" # Delete the example *.sr files. RMDir /r "$INSTDIR\examples\*" + # Delete the URL files for the manual. + Delete "$INSTDIR\PulseView HTML manual.url" + Delete "$INSTDIR\PulseView PDF manual.url" + # Delete the install directory and its sub-directories. RMDir "$INSTDIR\share" RMDir "$INSTDIR\examples" @@ -280,11 +294,16 @@ Section "Uninstall" # Delete the links from the start menu. Delete "$SMPROGRAMS\sigrok\PulseView\PulseView.lnk" + Delete "$SMPROGRAMS\sigrok\PulseView\PulseView (Debug).lnk" Delete "$SMPROGRAMS\sigrok\PulseView\Uninstall PulseView.lnk" Delete "$SMPROGRAMS\sigrok\PulseView\Zadig (PulseView).lnk" Delete "$SMPROGRAMS\sigrok\PulseView\Zadig (PulseView, Win XP).lnk" Delete "$SMPROGRAMS\sigrok\PulseView\Examples (PulseView).lnk" + # Delete the links to the manual. + Delete "$SMPROGRAMS\sigrok\PulseView\PulseView HTML manual.lnk" + Delete "$SMPROGRAMS\sigrok\PulseView\PulseView PDF manual.lnk" + # Delete the sub-directory in the start menu. RMDir "$SMPROGRAMS\sigrok\PulseView" RMDir "$SMPROGRAMS\sigrok" diff --git a/manual/CMakeLists.txt b/manual/CMakeLists.txt index a25a93f7..c425f36b 100644 --- a/manual/CMakeLists.txt +++ b/manual/CMakeLists.txt @@ -62,7 +62,7 @@ if (ASCIIDOCTOR_PDF_EXECUTABLE) else () add_custom_target(manual-pdf COMMAND ${CMAKE_COMMAND} -E echo - "asciidoctor-pdf executable is missing, NOT generating HTML output" + "asciidoctor-pdf executable is missing, NOT generating PDF output" DEPENDS ${MANUAL_SRC} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )