Skip to content
⌘ NSIS Forum Archive

stringContains function ?

7 posts

grahama#

stringContains function ?

I want to see if the $EXEDIR string contains the $INTERNET_CACHE string.

Is there some kind of 'string contains' function out there?

been a while since I last used NSIS, so I am a bit rusty
g
grahama#
this came up with nada
I'm sure it is something stupid...
anyone know how it should be amended ?

or, is there a better way to check if your exe is located somewhere in the internet cache...

Push $EXEDIR
Push $INTERNET_CACHE
Call StrStr
Pop $R0
MESSAGEBOX MB_OK "$R0"
grahama#
thanks 🙂 that makes sense...and it works now

Is there a reason why the below would not copy the file to the desktop ?
InCacheFolder: is running...just not copying
Does it have something to do with the exe [when downloaded] being run from its current location ?


Function AreWeInTheInternetCacheFolder
Push $EXEDIR ;string to search IN
Push $INTERNET_CACHE ;search string
Call StrStr
Pop $R0
strcmp $R0 "" NotInCacheFolder InCacheFolder

InCacheFolder:
;copy exe to the desktop
CopyFiles /SILENT "$EXEDIR\${FILETITLE}.exe" "$DESKTOP\${FILETITLE}.exe"
grahama#
so, can you copy the install exe while it is executing with copyFiles ?
or, do I need to redownload/extract it if necessary

many thanks
g