[PATCH] Use latin1 in NSIS (fixes encoding errors) Fix command line installation dir

Wald Commits scm-commit at wald.intevation.org
Tue May 27 19:45:16 CEST 2014


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1401211653 0
# Node ID a4e75d90d3f67f79d3c948cb551fc7119ed2f6b9
# Parent  02a89710a7cd5dd288c6b5f9d1171c6476edf33f
Use latin1 in NSIS (fixes encoding errors) Fix command line installation dir.

diff -r 02a89710a7cd -r a4e75d90d3f6 packaging/tmp-createpackage.sh.in
--- a/packaging/tmp-createpackage.sh.in	Tue May 27 16:31:29 2014 +0000
+++ b/packaging/tmp-createpackage.sh.in	Tue May 27 17:27:33 2014 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
+# Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
 # Software engineering by Intevation GmbH
 #
 # This file is Free Software under the GNU GPL (v>=2)
@@ -21,7 +21,7 @@
 
 echo $TMPDIR
 makensis -Dfiles_dir=$TMPDIR \
-    -Dcompany="Bundesamt für Sicherheit in der Informationstechnik" \
+    -Dcompany="Bundesamt für Sicherheit in der Informationstechnik" \
     -Dversion_number=@PROJECT_VERSION@ \
     -Dsetupname="@CMAKE_BINARY_DIR@/TrustBridge- at PROJECT_VERSION@.exe" \
     -Dproductname="TrustBridge" \
diff -r 02a89710a7cd -r a4e75d90d3f6 packaging/trustbridge.nsi
--- a/packaging/trustbridge.nsi	Tue May 27 16:31:29 2014 +0000
+++ b/packaging/trustbridge.nsi	Tue May 27 17:27:33 2014 +0000
@@ -1,4 +1,4 @@
-; Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
+; Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
 ; Software engineering by Intevation GmbH
 ;
 ; This file is Free Software under the GNU GPL (v>=2)
@@ -29,6 +29,7 @@
 
 !include "MultiUser.nsh"
 !include "MUI2.nsh"
+!include "FileFunc.nsh"
 
 ;--------------------------------
 ;Version Information (for installer file properties)
@@ -66,7 +67,7 @@
 !define MUI_UNICON "resources\uninstall.ico"
 
 ; MUI welcome page text
-!define MUI_WELCOMEPAGE_TITLE  "Willkommen bei der Installation des ${productname}"
+!define MUI_WELCOMEPAGE_TITLE  "Willkommen bei der Installation von ${productname}"
 !define MUI_WELCOMEPAGE_TEXT "Dieser Assistent wird Sie durch die Installation von \
 ${productname} begleiten. $\r$\n$\r$\n\
 ${productname} ist eine Anwendung um Wurzelzertifikate auf ihrem System \
@@ -88,10 +89,10 @@
 !define MUI_FINISHPAGE_TEXT  "${productname} wurde auf Ihrem \
 Computer installliert. $\r$\n$\r$\n\
 Klicken Sie auf 'Fertig stellen', um den Installations-Assistenten\
-zu schließen."
-!define MUI_FINISHPAGE_RUN $INSTDIR\trustbridge.exe
-!define MUI_FINISHPAGE_RUN_TEXT "Anwendung starten"
-!define MUI_FINISHPAGE_RUN_FUNCTION RunAsUser
+zu schließen."
+;!define MUI_FINISHPAGE_RUN $INSTDIR\trustbridge.exe
+;!define MUI_FINISHPAGE_RUN_TEXT "Anwendung starten"
+;!define MUI_FINISHPAGE_RUN_FUNCTION RunAsUser
 !define MUI_FINISHPAGE_LINK "Mehr unter http://www.bsi.bund.de" 
 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.bsi.bund.de"
 
@@ -112,7 +113,24 @@
 ; Install Functions
 
 Function ".onInit"
+  Var /GLOBAL is_update
+  Var /GLOBAL changed_dir
+  ${GetParameters} $R0
+  ClearErrors
+  ${GetOptions} $R0 /UPDATE= $is_update
+
+; Check if the install directory was modified on the command line
+  StrCmp "$INSTDIR" "$PROGRAMFILES\${productname_short}" unmodified 0
+  ; It is modified. Save that value.
+  StrCpy $changed_dir "$INSTDIR"
+
+; MULITUSER_INIT overwrites directory setting from command line
   !insertmacro MULTIUSER_INIT
+  StrCpy $INSTDIR "$changed_dir"
+  goto initDone
+unmodified:
+  !insertmacro MULTIUSER_INIT
+initDone:
 FunctionEnd
 
 ; If we run elevated we do not want to run
@@ -134,14 +152,17 @@
   SetOutPath "$INSTDIR"
   !include "filelist.nsh"
 
+;Create uninstaller
+  WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+; Code below is not run on updates
+  StrCmp $is_update '1' done
+
   WriteRegStr SHCTX "Software\${productname_short}" "" $INSTDIR
 
 ; Set up autostart
   WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Run" "TrustBridge" "$INSTDIR\trustbridge.exe --tray"
 
-;Create uninstaller
-  WriteUninstaller "$INSTDIR\Uninstall.exe"
-
   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 
   ;Create shortcuts
@@ -149,6 +170,7 @@
   CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${productname}.lnk" "$INSTDIR\trustbridge.exe"
 
   !insertmacro MUI_STARTMENU_WRITE_END
+done:
 
 SectionEnd
 


More information about the Trustbridge-commits mailing list