|
|
#1 |
|
Junior Member
Join Date: Dec 2001
Location: Netherlands
Posts: 2
|
I just discovered NSIS last week and I want to deploy it for an upgrade of our application.
The application can be in any directory on the system and it has no entries in the registery. The only thing I know are the names of the files wich are installed. Is there a way to find the name of the directory with only the filename. I tried "GETFULLPATHNAME" but then I need to specify the path with the filename. Thanks. Jma. |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Aug 2001
Posts: 36
|
This installer performs a depth-first search: you can use it to find your files...
Name "Find Files" OutFile "Find Files.exe" Caption "Find Files" ; Use Show to let user see directories that are scanned ShowInstDetails Show ComponentText "Check he drives where you want the installer to scan for files." "" "Select drives to scan:" ; One section to scan drive C Section "Drive C:" ; set search root directory, omit the trainling backslash StrCpy $9 "C:" ; start searching Call FindFiles SectionEnd ; One section to scan drive D Section "Drive D:" ; set search root directory, omit the trainling backslash StrCpy $9 "D:" ; start searching Call FindFiles SectionEnd Function FindFiles GoAgain: ; look for any files or directories FindFirst $0 $1 "$9\*.*" IfErrors NotFound DoFindNext: StrCmp $1 "." SkipFile StrCmp $1 ".." SkipFile StrCmp $1 "readme.txt" "" CheckDirectory ; perform some action here, ie. replace the readme.txt file CheckDirectory: ; check if the current file actually is a subdirectory IfFileExists "$9\$1\*.*" "" SkipFile ; remember on stack Push "$9\$1" DetailPrint "$9\$1" SkipFile: ; continue with next file in current directory ClearErrors FindNext $0 $1 IfErrors "" DoFindNext ; no more file in current directory FindClose $0 NotFound: ; check if we found any subdirectories Pop $9 IfErrors "" GoAgain FunctionEnd |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2001
Location: Netherlands
Posts: 2
|
Thanks!
Just what I needed .
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Oct 2001
Posts: 145
|
If you make a full installer for your product in NSIS, make sure you do the following to avoid this dilemma:
code: And when you want to make an upgrade for your product, use this: code: You can then use InstallDir in the following way InstallDir "$5" in order to install the upgrade to the same directory. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|