|
|
#1 |
|
Member
Join Date: Jan 2003
Posts: 83
|
Situation is, I want to include a console progie to my installer (nsis is the best
), however it has one anoying (in my case) feature - to quit it you have to press enter-key (i guess it was implemented to let a user see output or something). This proggie works several times during install, and each time user would have to click enter - and that's pointless and irritating.Is there some way around this, like emulating a key-press? Terminating a dosbox is not an option, I tried it and it messed up the proggie's work. PS: I realise that my question is not quite related to NSIS, but I didn't know where else I could ask, and I see lots of experienced people here, programmers and such...
|
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
|
You could try using
(note you have to include WinMessages.nsh to define the WM_KEYDOWN variable). This should send a return key press to the window (13 is the ASCII value of carriage return). (this might help give you an idea of how SendMessage can be used)code: Alternatively something like AutoIt can be used to control applications using key presses and mouse actions. |
|
|
|
|
|
#3 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
I think nsExec can also help you. As it runs the console application "inside" NSIS it can't get any output so it won't do nothing when the user presses enter.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#4 |
|
Member
Join Date: Jan 2003
Posts: 83
|
Thanks for the input Sunjammer!
Tried that AutoIt thingie, it's cool, never thought such tool existed . Plus it adds another exe to my install.So if you said that it's possible to do it with nsis, that would be so much better. And I'll use AutoIt only as a last resort. Anyway, I tried to use the code you gave, and it didn't work out.PHP Code:
And out of sudden, sometimes it does nothing at all, sometimes it screws-up the dos-box and one time it even screwed-up keyboard and mouse - they started to work incorrectly. btw, from silliness at first I tried looping it, something like: PHP Code:
Kids, don't try this at home! WTH? Any ideas? Note that I have no experience in programming of any sort, and started to use nsis recently. But I'd really like to get it going. ![]() TIA, galil Last edited by galil; 19th February 2003 at 22:29. |
|
|
|
|
|
#5 |
|
Major Dude
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
|
I've just got home (2am here
) -- I'll try to look at this for you tomorrow morning at work if I can.
|
|
|
|
|
|
#6 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Ignore what I have said, it does wait for enter (at least for makensis).
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|