--- a/HuginSetup_common.nsh
+++ b/HuginSetup_common.nsh
@@ -61,7 +61,6 @@
   !insertmacro MUI_PAGE_WELCOME
   ;!insertmacro MUI_PAGE_LICENSE $(License_Hugin)
   !insertmacro MUI_PAGE_LICENSE "Licenses\GPLv2.txt"
-  !insertmacro MUI_PAGE_DIRECTORY
   !insertmacro MUI_PAGE_COMPONENTS
   
   ; Additional license agreement
@@ -71,6 +70,7 @@
   !define MUI_PAGE_CUSTOMFUNCTION_PRE skipControlPointsDisclaimer
   !insertmacro MUI_PAGE_LICENSE ${CP_LICENSE_DISCLAIMER}
   
+  !insertmacro MUI_PAGE_DIRECTORY
   !insertmacro MUI_PAGE_INSTFILES
   !insertmacro MUI_PAGE_FINISH
   
@@ -105,6 +105,7 @@
   Delete "$OUTDIR\${HUGIN_BIN_ARCHIVE}" 
   Delete "$OUTDIR\${HUGIN_SHARE_ARCHIVE}"
   
+  Call AddCPAutoPanoSiftCStacked
   Call AddCPAlignImageStack
   
   Call WriteUninstallRegistry
@@ -288,6 +289,27 @@
   ; MessageBox MB_OK "How many CP now?? $0"
   WriteRegDWORD HKCU "Software\hugin\AutoPano" "AutoPanoCount" $0
 FunctionEnd
+
+; Write registry settings for CP Stacked
+; R0 = Type [Matcher|Stack]
+; R1 = Autopano_ID (-1 for last setting present)
+; R2 = Program
+; R3 = Arguments
+Function ControlPointRegistryAddMulti
+  IntCmp $R1 -1 0 ok
+    ReadRegDWORD $0 HKCU "Software\hugin\AutoPano" "AutoPanoCount"
+    ; Make sure it's an Integer (empty string if AutoPanoCount doesn't exists)
+    IntOp $0 $0 - 1
+    StrCpy $R1 $0
+  ok:
+  
+  MessageBox MB_OK "Adding $R0 as $R2: '$R4' ($R3) into AutoPano_$0"
+
+  ; Writing settings
+  WriteRegStr   HKCU "Software\Hugin\AutoPano\AutoPano_$0" "Program$R0" "$R2"
+  WriteRegStr   HKCU "Software\Hugin\AutoPano\AutoPano_$0" "Arguments$R0" "$R3"
+FunctionEnd
+
 
 ; Return on top of stack the total size of the selected (installed) sections, formated as DWORD
 ; Assumes no more than 256 sections are defined
@@ -317,6 +339,30 @@
   StrCpy $R4 "Align image stack";  R4 = Description
   Call ControlPointRegistryAdd
 FunctionEnd
+
+; Add Align_Image_stack control point generator settings
+Function AddCPAutoPanoSiftCStacked
+  StrCpy $R0 4 ; R0 = Type
+  StrCpy $R1 1 ; R1 = Option
+  StrCpy $R2 "$INSTDIR\bin\generatekeys.exe" ; R2 = Program
+  StrCpy $R3 "%i %k 800" ; R3 = Arguments
+  StrCpy $R4 "Autopano-SIFT-C (multirow/stacked)";  R4 = Description
+  Call ControlPointRegistryAdd
+  
+  StrCpy $R0 "Matcher" ; R0 = Type [Matcher|Stack]
+  StrCpy $R1 "-1"; R1 = Autopano_ID (-1 for last setting present)
+  StrCpy $R2 "$INSTDIR\bin\autopano.exe" ; R2 = Program
+  StrCpy $R3 "--maxmatches %p %o %k"; R3 = Arguments
+  Call ControlPointRegistryAddMulti
+  
+  StrCpy $R0 "Stack" ; R0 = Type [Matcher|Stack]
+  StrCpy $R1 "-1"; R1 = Autopano_ID (-1 for last setting present)
+  StrCpy $R2 "$INSTDIR\bin\align_image_stack.exe" ; R2 = Program
+  StrCpy $R3 "-f %v -v -p %o %i"; R3 = Arguments
+  Call ControlPointRegistryAddMulti  
+  
+FunctionEnd
+
 
 ; Write uninstall informations into Windows Register
 Function WriteUninstallRegistry