Story
Hello to all,
Is there a way to recursively move a directory with NSIS at compile time?
thanks
Long story
Hello to all,
I am trying to create an installer with NSIS for the software that I am developing. The build system we created creates a folder with everything you need to run this software on Windows (dll, exes, images, libraries, examples, etc.). There are +400 files and folders in this folder. Using HM NIS Edit, it was possible to create the “File” and “SetOutPath” sequences needed to set all the content, but just huge, ugly, and if some files were added or deleted, we had to change the script manually.
So ... we removed the generated sequence "File" and "SetOutPath" and simply added:
File /r "C:\path\to\output\dir"
It works fine ... but now we have a problem with the uninstaller, because we can not do this:
RMDir /r $INSTDIR
Because it is dangerous (as indicated here: http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.8 ).
So, we tried to follow the recommendation there: http://nsis.sourceforge.net/Uninstall_only_installed_files
This solution creates a log in which NSIS records all completed File and SetOutPath operations so that it can back out (delete) when it is deleted. The problem is that the included macros do not support the recursive "File" option.
I tried to implement a recursive version by recursively walking around a folder, but I think I'm doing it wrong (well, I'm sure: P):
!include "RecFind.nsh" Section "Principal" SEC01 ${SetOutPath} "$INSTDIR" SetOverwrite try ${RecFindOpen} "..\executable" $R0 $R1 DetailPrint "Looking into directory: $R0" ${SetOutPath} "$R0" ${RecFindFirst} DetailPrint "Looking file: $R0\$R1" ${File} "$R0" "$R1" ${RecFindNext} ${RecFindClose}
Using this http://nsis.sourceforge.net/RecFind:_Recursive_FindFirst,_FindNext,_FindClose But I think it only works during installation.
The solution I have found so far is to create a script installer with the NSIS file used as the template (with some placeholder token for the File and SetOutPath lists), a Python script that goes through the output directory and creates the sequence " File "and" SetOutPath "and then writes the final NSIS script ... but I really don't like it: S
So my question is:
Is there a way to recursively move a directory with NSIS at compile time?
(Or, how can I achieve this only with NSIS?).
Thanks in advance.
Yours faithfully