my script uses the GetParameters and the GetFileName function from the archive. the idea is to let my installer open a file, which works..
this works
MyInstaller.exe C:\Documents and Settings\MyFile.ini
this does not work
MyInstaller.exe "C:\Documents and Settings\MyFile.ini"
i tried using '-quotes in my installer, but it still doesn't work. any hint how to avoid this?
parameter question
9 posts
You need to remove the quotes. GetParamaters leaves them on.
Use StrReplace on the archive:
-Stu
Use StrReplace on the archive:
-Stu
was hoping on something simpler/shorter, but that'll do. thanks, stu 🙂
another weird thing is happening
the first file-check works (full path to file is supplied). however, i added a second check, in case the file is stored in the same dir as my installer. that part never works.IfFileExists "$Input" ValidInput 0
IfFileExists "$EXEDIR\$Input" 0 InvalidInput
StrCpy $Input "$EXEDIR\$Input"
Goto ValidInput
Command line example:Name 'Output'
OutFile 'Output.exe'
!include "FileFunc.nsh"
!insertmacro GetParameters
!include "WordFunc.nsh"
!insertmacro WordFind2X
Section
${GetParameters} $R0
StrCpy $0 0
loop:
IntOp $0 $0 + 1
${WordFind2X} '$R0' '"' '"' 'E+$0' $1
IfErrors end
MessageBoX MB_YESNO "[$1]$\n$\nNext Parameter?" IDYES loop
end:
SectionEnd
Script used headersOutput.exe "C:\Documents and Settings\File1.ini" "C:\Documents and Settings\File2.ini" ...
but what exactly is it, that doesn't make the code of my previous post work?
You wrote:
Second question:
If full path to "$Input" is supplied then "$EXEDIR\$Input" - incorrect path.
was hoping on something simpler/shorter...My previous post it's answer to your first question.
Second question:
If full path to "$Input" is supplied then "$EXEDIR\$Input" - incorrect path.
yes, but if i don't supply a full path, then IfFileExists still returns that the file exists. later when i'm using ReadRegStr it doesn't work, because it'd need the full path.
my script never comes to the 2nd IfFileExist, unregarding if i supply a path or not. shouldn't this be considered as a bug in nsis?
my script never comes to the 2nd IfFileExist, unregarding if i supply a path or not. shouldn't this be considered as a bug in nsis?
IfFileExists "$EXEDIR\$Input" 0 +3
StrCpy $Input "$EXEDIR\$Input"
Goto ValidInput
IfFileExists "$Input" ValidInput InvalidInput