Răsfoiți Sursa

Merge pull request #245 from bastimeyer/install-rm-pkgs

Add install_pkgs block to pyapp.nsi template
Thomas Kluyver 3 ani în urmă
părinte
comite
336a7cdf14
1 a modificat fișierele cu 18 adăugiri și 2 ștergeri
  1. 18 2
      nsist/pyapp.nsi

+ 18 - 2
nsist/pyapp.nsi

@@ -66,8 +66,24 @@ Section "!${PRODUCT_NAME}" sec_app
   SetRegView [[ib.py_bitness]]
   SectionIn RO
   File ${PRODUCT_ICON}
-  SetOutPath "$INSTDIR\pkgs"
-  File /r "pkgs\*.*"
+
+  [% block install_pkgs %]
+    [#
+      Extend this block if you need to remove the pkgs directory if it already
+      exists from previous installations (when upgrading without uninstalling).
+      https://github.com/takluyver/pynsist/issues/66
+
+      Example:
+      [% block install_pkgs %]
+        RMDir /r "$INSTDIR\pkgs"
+        [[ super() ]]
+      [% endblock install_pkgs %]
+    #]
+    ; Copy pkgs data
+    SetOutPath "$INSTDIR\pkgs"
+    File /r "pkgs\*.*"
+  [% endblock install_pkgs %]
+
   SetOutPath "$INSTDIR"
 
   ; Marker file for per-user install