[Greater-commits] r3824 - in trunk/packaging: . includes

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Nov 22 15:59:53 CET 2011


Author: aheinecke
Date: 2011-11-22 15:59:53 +0100 (Tue, 22 Nov 2011)
New Revision: 3824

Added:
   trunk/packaging/includes/trim.nsh
   trunk/packaging/password-options.ini
Log:
Add new files necessary for the passwort edit


Added: trunk/packaging/includes/trim.nsh
===================================================================
--- trunk/packaging/includes/trim.nsh	2011-11-22 14:59:13 UTC (rev 3823)
+++ trunk/packaging/includes/trim.nsh	2011-11-22 14:59:53 UTC (rev 3824)
@@ -0,0 +1,67 @@
+; Trim
+;   Removes leading & trailing whitespace from a string
+; Usage:
+;   Push
+;   Call Trim
+;   Pop
+
+Function Trim
+    Exch $R1 ; Original string
+    Push $R2
+
+Loop:
+    StrCpy $R2 "$R1" 1
+    StrCmp "$R2" " " TrimLeft
+    StrCmp "$R2" "$\r" TrimLeft
+    StrCmp "$R2" "$\n" TrimLeft
+    StrCmp "$R2" "$\t" TrimLeft
+    GoTo Loop2
+TrimLeft:
+    StrCpy $R1 "$R1" "" 1
+    Goto Loop
+
+Loop2:
+    StrCpy $R2 "$R1" 1 -1
+    StrCmp "$R2" " " TrimRight
+    StrCmp "$R2" "$\r" TrimRight
+    StrCmp "$R2" "$\n" TrimRight
+    StrCmp "$R2" "$\t" TrimRight
+    GoTo Done
+TrimRight:
+    StrCpy $R1 "$R1" -1
+    Goto Loop2
+
+Done:
+    Pop $R2
+    Exch $R1
+FunctionEnd
+
+!define Trim "!insertmacro Trim"
+
+!macro Trim ResultVar String
+  Push "${String}"
+  Call Trim
+  Pop "${ResultVar}"
+!macroend
+
+Function CheckForSpaces
+ Exch $R0
+ Push $R1
+ Push $R2
+ Push $R3
+ StrCpy $R1 -1
+ StrCpy $R3 $R0
+ StrCpy $R0 0
+ loop:
+   StrCpy $R2 $R3 1 $R1
+   IntOp $R1 $R1 - 1
+   StrCmp $R2 "" done
+   StrCmp $R2 " " 0 loop
+   IntOp $R0 $R0 + 1
+ Goto loop
+ done:
+ Pop $R3
+ Pop $R2
+ Pop $R1
+ Exch $R0
+FunctionEnd

Added: trunk/packaging/password-options.ini
===================================================================
--- trunk/packaging/password-options.ini	2011-11-22 14:59:13 UTC (rev 3823)
+++ trunk/packaging/password-options.ini	2011-11-22 14:59:53 UTC (rev 3824)
@@ -0,0 +1,51 @@
+[Settings]
+NumFields=6
+
+[Field 1]
+Type=label
+Text="Please enter a password for the PostgreSQL database (default: greater):"
+Left=0
+Right=-1
+Top=0
+Bottom=20
+
+[Field 2]
+Type=label
+Text=Password:
+Left=0
+Right=79
+Top=20
+Bottom=30
+
+[Field 3]
+Type=password
+Left=80
+Right=180
+Top=20
+Bottom=30
+State=greater
+
+[Field 4]
+Type=Label
+Text="Repeat Password:"
+Left=0
+Right=79
+Top=40
+Bottom=50
+
+[Field 5]
+Type=password
+Left=80
+Right=180
+Top=40
+Bottom=50
+State=greater
+
+[Field 6]
+Type=Checkbox
+Text="Enable Automatic Login (saves password in plain text!)"
+Left=0
+Right=-1
+Top=60
+Bottom=70
+State=1



More information about the Greater-commits mailing list