Old 25th September 2006, 19:42   #1
manstir
Junior Member
 
Join Date: Sep 2006
Posts: 1
File "/oname" $variable

Problem:
File "/oname=$WINDIR\system32\$UpdateFileSys32" "$UpdateFileSys32Dir\$UpdateFileSys32"

Error: File "$UpdateFileSys32Dir\$UpdateFileSys32" -> no files found.

The File Function does not except a variable instead a SrcPath. Do you know a workaround?

Description:
My Installer copies some .dll files into the $WINDIR\system32 folder.
All these Files are stored in the directory \src\system32.
before the installert copies the file to the destination it checks the version of the existing files. The Installer checks File after File in this Procedure. By the Time I would like to write the File I got the Name in a Variable!

Code:
PHP Code:
StrCpy $UpdateFileSys32Dir "src\system32"
  
  
FindFirst $0 $UpdateFileSys32 "$UpdateFileSys32Dir\*" ;$INSTDIR\*.txt
  loop
:
    
StrCmp $UpdateFileSys32 "" done
         
${If} $UpdateFileSys32 != ""
      
${GetFileVersion"$UpdateFileSys32$FileVersionO
        DetailPrint 
"Datei $UpdateFileSys32 Version: $FileVersionO liegt zur Installation bereit"
        
${If} ${FileExists"$WINDIR\system32\$UpdateFileSys32"
          
${GetFileVersion"$UpdateFileSys32$FileVersionN
          DetailPrint 
"File already exists: $WINDIR\system32\$UpdateFileSys32 Version: $FileVersionN"
          
${VersionCompare$FileVersion0 $FileVersionN $tmp
          
${If} $tmp == "1"
            
DetailPrint "The existing File is newer. $UpdateFileSys32 File not replaced"
          
${Else}
            
DetailPrint "The existing Version is equal or older. $UpdateFileSys32 Copy File... "
            
;SetOutPath "$WINDIR\system32\"
            File "
/oname=$WINDIR\system32\$UpdateFileSys32" "$UpdateFileSys32Dir\$UpdateFileSys32"
            DetailPrint "
$UpdateFileSys32Dir\$UpdateFileSys32 File replaced"
          
${EndIf}
        
${EndIf}
        DetailPrint "
---"
    
${EndIf}
  FindNext $0 
$UpdateFileSys32
  Goto loop
done: 
manstir is offline   Reply With Quote
Old 25th September 2006, 21:23   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You've got your variable use messed up.
Variables are for run time use, so naturally you can't use them on compile time.

-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