WINAMP.COM | Forums > Developer Center > NSIS Discussion > Help needed to compile helper! |
Last Thread
Next Thread
|
| Author |
|
|
Red Wine Forum King
Registered: Mar 2006 |
Help needed to compile helper!
well, based on Instructor's functions and code posted on other topics I'm trying to compile a script that takes a given directory and builds a proper list ready to !include in install section. This could be a helper to parse the entire directory structure in the installation script. The code that I'm figuring is this: code: The resulting list where I really stuck is this: code: I can't handle how I should write the code to eliminate the repeated lines 'SetOutPath...' and 'CreateDirectory...' so the resulting list will be like this: code: Help please! __________________ Last edited by Red Wine on 03-23-2006 at 10:36 PM |
||
|
|
|
Afrow UK Moderator
Registered: Nov 2002 |
I'm not sure why CreateDirectory is being used in the first place. With the above code you'll find that all the files will get dumped in $INSTDIR (because SetOutPath sets the output directory, and it's being set to $INSTDIR to begin with and it's never being changed thereafter). code: Although the code is much simpler you have less options here. I actually implemented a file extension filter into ${RecFindFirst} but for some reason I never uploaded the changes and now I've lost them altogether. I'll probably sort this out sometime. -Stu __________________ |
||
|
|
|
Red Wine Forum King
Registered: Mar 2006 |
oops sorry! __________________ |
||
|
|
|
Red Wine Forum King
Registered: Mar 2006 |
@ -Stu code: Quite close to what I'm looking for!!! I should change the variables when writing to the file to point the InstallDir and subdirs and create them also. That's OK I guess, I'm going to make it later. Yet, there are some strange things with the quotes. How should I fix them? Thanks anyway! __________________ |
||
|
|
|
Instructor Major Dude
Registered: Jul 2004 |
You don't need CreateDirectory because SetOutPath create it. __________________ |
||
|
|
|
Red Wine Forum King
Registered: Mar 2006 |
Hi Instructor, __________________ |
||
|
|
|
Afrow UK Moderator
Registered: Nov 2002 |
No need for this at all in the RecFind script: code: Anything between ${RecFindOpen} and ${RecFindFirst} is executed only when moving into a new directory and not for each new file found. Also $R0 (the directory path) will never be empty "" so it will always jump to the second FileWrite instruction anyway. Therefore you just need: code: SetOutPath creates the directories recursively as well! So no need for CreateDirectory. -Stu __________________ |
||
|
|
|
Instructor Major Dude
Registered: Jul 2004 |
code: __________________ |
||
|
|
|
Red Wine Forum King
Registered: Mar 2006 |
@ Stu: __________________ |
||
|
|
|
Red Wine Forum King
Registered: Mar 2006 |
OK, no need for CreateDirectory while SetOutPath creates the directories recursively as mentionend above. I use it just to have the list in tact. __________________ |
||
|
|
|
Instructor Major Dude
Registered: Jul 2004 |
code: __________________ |
||
|
|
|
Red Wine Forum King
Registered: Mar 2006 |
COOL! Both working perfect! __________________ |
||
|
|
|
Last Thread Next Thread
|
WINAMP.COM | Forums > Developer Center > NSIS Discussion > Help needed to compile helper! |
Forum Rules:
|