|
![]() |
#1 |
Junior Member
Join Date: Apr 2010
Posts: 8
|
![]()
Hello,
I am facing two problems with NSIS scripts. I am new on this but if someone could help me would be great... I have to do a installer that runs from a command prompt. I have to set some parameter that the user needs to set (I have done that already), but if the user doesn´t pass the parameter the installer should show a message on command prompt usage: installer.exe -d <directory> the other problem is that when I run the uninstall i have to zip the directory and save to a backup, I saw all the plugins but they just extract zip files they don´t create one... can anyone help me? |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
To create Zip files you could include a copy of 7za.exe (7-zip.org) and extract and execute that (with ExecDos/nsExec). The executable is a little on the heavy side but I'm not sure if there are any other freely available command line zippers out there.
Stu Last edited by Afrow UK; 29th April 2010 at 14:17. Reason: see Anders' post! |
![]() |
![]() |
![]() |
#3 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
|
I have coded this several times for other people, try a forum search next time...
On XP and later it can be done perfectly: http://forums.winamp.com/showpost.ph...79&postcount=4 For older platforms, there is no AttachConsole so you would have to call AllocConsole instead on those systems IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#4 |
Junior Member
Join Date: Apr 2010
Posts: 8
|
Thanks a lot guys...
Was very helpfull |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Apr 2010
Posts: 8
|
![]()
Hi guys,
I have done this way... thanks for the help ![]() code: |
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
|
You should not use writeconsole to write plain ansi text, use WriteFile (If you use WriteFile, the output can be redirected and/or piped)
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Apr 2010
Posts: 8
|
Hum ok...
I changed to System::Call "kernel32::WriteFile(i r0, t R0, i R4, i r1, i 0)" well I have another question Anders... Is there a way to keep the prompt right after the command? like c:\>example.exe -d d: <here comes the error message> instead of what is doing now c:\>example.exe -d d: c:\> Error Message |
![]() |
![]() |
![]() |
#8 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
|
Quote:
As far as the newline goes, the answer is yes and no. The short answer is, NO. The long answer is, you have full control over the console buffer and can do anything you want to it by calling the correct windows api's IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
|
Tags |
comman prompt, compress file |
Thread Tools | Search this Thread |
Display Modes | |
|
|