Archive: Scripting Question


Scripting Question
Hi All!
I am a developer currently working on using this most excellent installer for Quake III mods a friend of mine makes. His newest will be using the NSIS for packaging and I can say that i could not be more pleased with it. In the time it took me to find info on .msi creation, I wrote the basic script for the package in NSIS. ROCK! I am having a bit of trouble with one part though.
Being that it is a Quake III mod, all installations on all computers have to be in the Same dir under the Quake III program folder (i.e. <Q3>\BQ3) for network play to work properly. I am thinking there is a way to make sure that the dir is the same by appending it to the dir you install to, like how ICQ does always having ICQ as the dir name...but I am not sure how to do it =( Is there anyone who would be willing to help provide a simple script to do such a thing? I have been playing around with the Strcpy functions...but not coming up with much. would appreciate any help I can get on this! Thank you!


If Q3 makes some registry settings, try to find the Q3 root in the
registry (ReadRegStr $0 HKLM "Software\Q3" "Q3Root" might work) and
use StrCpy $0 "$0\BQ3"
and set the $INSTDIR to this value.

Or you could ask the user to find the Q3 dir by DirRequest or the
main program of Q3 by FileRequest using InstallOptions.

I hope this answers your question...

- :D Hendri :D -


Thank you!
Smile2Me:
Thank you! I will most certainly try this out. there must be a dir listing for Q3 and I sure hope I find it. I apologize for not responding sooner. Just got back from Thanxgiving family-visit. =) Thanx again mate!


I'd like to know how you are catching the compiler output. Thats pretty cool :)


Compiler Output
Ackbar:

In running Win2k, I use the cmd interface lots and I just scroll through everything it prints when it compiles. This is mucho nice for error detection, which thank the head Llamas, is very easy to understand if you've ever programmed. (Thankyouthankyouthankyou). I didn't know if you were asking me or not, if not, then ignore this message =D


How do you capture whats being scrolled by the command interface? thanks :)


Slyde,

it's ok, have fun, greetz,

- :D Hendri :D -


Capture from Commandline
Ackbar:
Basically, just reading it. if you needed to capture, you'd just need to highlight with the mouse and then right click, whenever you are in cmd and do that, what you had highlighted is copied and you can paste in other places. Ctrl+C and Ctrl+V don't work there. it's all done with the right mouse button. like, fi you had to paste something to cmd, just highlight in the otehr window, copy it and go to cmd and right click anywhere on the cmd screen, and it's pasted. that's all there is to it =)


Nice Joke :) Nah I actually figured it out. I was after capturing the return data from a shelled application through a program :)


Smile2Me is Great! Give Us Chocolate Cake!
ReadRegStr $0 HKLM "Software\Id\Quake III Arena" "INSTALLPATH"
StrCpy $0 "$0\BQ3"
StrCpy $INSTDIR $0

Not as advanced as i would like, but it works just fine, and since the user can't change it, there is no way the mod would get installed to the wrong dir. Thanx for the help mate! It was a life-saver!

*prances around Smile2Me singing praises*


Slyde,

You can change your code:
ReadRegStr $0 HKLM "Software\Id\Quake III Arena" "INSTALLPATH"
StrCpy $0 "$0\BQ3"
StrCpy $INSTDIR $0

into:
ReadRegStr $0 HKLM "Software\Id\Quake III Arena" "INSTALLPATH"
StrCpy $INSTDIR "$0\BQ3"

to save some bytes...

And thanx for your kind words :D
It's nice to help out friends...

- :D Hendri :D -


Originally posted by Ackbar
Nice Joke :) Nah I actually figured it out. I was after capturing the return data from a shelled application through a program :)
Here is your solution:

http://msdn.microsoft.com/library/de...thred_4uus.asp

The above link links to "Creating a Child Process with Redirected Input and Output" in the MSDN

Grz,

Michel