]> sigrok.org Git - sigrok-cli.git/blobdiff - contrib/sigrok-cli.nsi.in
Deprecate SR_DI_TRIGGER_SOURCES.
[sigrok-cli.git] / contrib / sigrok-cli.nsi.in
index 083db4a3ab4e897421a9d4fcae8953688e49fa9f..6958c012685cab99df9e7858323619673ba2321c 100644 (file)
 Name "@PACKAGE_NAME@"
 
 # Filename of the installer executable.
-OutFile "@PACKAGE_NAME@-installer-@PACKAGE_VERSION@.exe"
+OutFile "@PACKAGE_NAME@-@PACKAGE_VERSION@-installer.exe"
 
 # Where to install the application.
 InstallDir "$PROGRAMFILES\sigrok\@PACKAGE_NAME@"
 
-# Request application privileges for Windows Vista.
-RequestExecutionLevel user
+# Request admin privileges for Windows Vista and Windows 7.
+# http://nsis.sourceforge.net/Docs/Chapter4.html
+RequestExecutionLevel admin
+
+# Local helper definitions.
+!define REGSTR "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE_NAME@"
 
 
 # --- MUI interface configuration ---------------------------------------------
@@ -124,6 +128,9 @@ Section "@PACKAGE_NAME@ (required)" Section1
        # sigrok-cli
        File "c:\MinGW\msys\1.0\local\bin\@PACKAGE_NAME@.exe"
 
+       # Icon
+       File "sigrok-logo-notext.ico"
+
        # MinGW libs
        File "c:\MinGW\bin\mingwm10.dll"
        File "c:\MinGW\bin\libgcc_s_dw2-1.dll"
@@ -131,6 +138,10 @@ Section "@PACKAGE_NAME@ (required)" Section1
        File "c:\MinGW\bin\libiconv-2.dll"
        File "c:\MinGW\bin\libstdc++-6.dll"
 
+       # MSYS libs.
+       File "c:\MinGW\msys\1.0\bin\msys-1.0.dll"
+       File "c:\MinGW\msys\1.0\bin\msys-z.dll"
+
        # External libs
        File "c:\MinGW\msys\1.0\local\bin\libglib-2.0-0.dll"
        File "c:\MinGW\msys\1.0\local\bin\libgthread-2.0-0.dll"
@@ -154,13 +165,46 @@ Section "@PACKAGE_NAME@ (required)" Section1
        CreateDirectory "$SMPROGRAMS\sigrok"
        CreateDirectory "$SMPROGRAMS\sigrok\@PACKAGE_NAME@"
 
-       # TODO: Create a shortcut for sigrok-cli (DOS box? README only?).
+       # Create a shortcut for sigrok-cli (this merely opens a "DOS box").
+       # Set the working directory (where the user will be placed into when
+       # the DOS box starts) to the user's Desktop directory.
+       SetOutPath "$DESKTOP"
+       CreateShortCut "$SMPROGRAMS\sigrok\@PACKAGE_NAME@\sigrok command-line tool.lnk" \
+               "$SYSDIR\cmd.exe" \
+               "/K echo For instructions run @PACKAGE_NAME@ --help." \
+               "$SYSDIR\cmd.exe" 0 \
+               SW_SHOWNORMAL "" "Run @PACKAGE_NAME@"
 
        # Create a shortcut for the uninstaller.
        CreateShortCut "$SMPROGRAMS\sigrok\@PACKAGE_NAME@\Uninstall.lnk" \
                "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 \
                SW_SHOWNORMAL "" "Uninstall @PACKAGE_NAME@"
 
+       # Create registry keys for "Add/remove programs" in the control panel.
+       WriteRegStr HKLM "${REGSTR}" "DisplayName" "@PACKAGE_STRING@"
+       WriteRegStr HKLM "${REGSTR}" "UninstallString" \
+               "$\"$INSTDIR\Uninstall.exe$\""
+       WriteRegStr HKLM "${REGSTR}" "InstallLocation" "$\"$INSTDIR$\""
+       WriteRegStr HKLM "${REGSTR}" "DisplayIcon" \
+               "$\"$INSTDIR\sigrok-logo-notext.ico$\""
+       WriteRegStr HKLM "${REGSTR}" "Publisher" "sigrok"
+       WriteRegStr HKLM "${REGSTR}" "HelpLink" \
+               "http://sigrok.org/wiki/Sigrok-cli"
+       WriteRegStr HKLM "${REGSTR}" "URLUpdateInfo" \
+               "http://sigrok.org/wiki/Downloads"
+       WriteRegStr HKLM "${REGSTR}" "URLInfoAbout" "http://sigrok.org"
+       WriteRegStr HKLM "${REGSTR}" "DisplayVersion" "@PACKAGE_VERSION@"
+       WriteRegStr HKLM "${REGSTR}" "Contact" \
+               "sigrok-devel@lists.sourceforge.org"
+       WriteRegStr HKLM "${REGSTR}" "Comments" \
+               "This is the sigrok command-line application."
+
+       # Display "Remove" instead of "Modify/Remove" in the control panel.
+       WriteRegDWORD HKLM "${REGSTR}" "NoModify" 1
+       WriteRegDWORD HKLM "${REGSTR}" "NoRepair" 1
+
+       # TODO: Add sigrok-cli directory to the PATH env. variable.
+
 SectionEnd
 
 
@@ -193,11 +237,14 @@ Section "Uninstall"
        Delete "$INSTDIR\libsigrok.a"
        Delete "$INSTDIR\libsigrokdecode.a"
        Delete "$INSTDIR\@PACKAGE_NAME@.exe"
+       Delete "$INSTDIR\sigrok-logo-notext.ico"
        Delete "$INSTDIR\mingwm10.dll"
        Delete "$INSTDIR\libgcc_s_dw2-1.dll"
        Delete "$INSTDIR\intl.dll"
        Delete "$INSTDIR\libiconv-2.dll"
        Delete "$INSTDIR\libstdc++-6.dll"
+       Delete "$INSTDIR\msys-1.0.dll"
+       Delete "$INSTDIR\msys-z.dll"
        Delete "$INSTDIR\libglib-2.0-0.dll"
        Delete "$INSTDIR\libgthread-2.0-0.dll"
        Delete "$INSTDIR\libusb-1.0.dll"
@@ -215,12 +262,16 @@ Section "Uninstall"
        RMDir "$INSTDIR"
 
        # Delete the links from the start menu.
+       Delete "$SMPROGRAMS\sigrok\@PACKAGE_NAME@\sigrok command-line tool.lnk"
        Delete "$SMPROGRAMS\sigrok\@PACKAGE_NAME@\Uninstall.lnk"
 
        # Delete the sub-directory in the start menu.
        RMDir "$SMPROGRAMS\sigrok\@PACKAGE_NAME@"
        RMDir "$SMPROGRAMS\sigrok"
 
+       # Delete the registry key(s).
+       DeleteRegKey HKLM "${REGSTR}"
+
 SectionEnd