- NSIS Discussion
- About FindWindow
Archive: About FindWindow
Freezerman350
31st March 2005 15:18 UTC
About FindWindow
I wanna find if the process "ServiceTS" is running in background....
if yes, setOverwrite at try, else skip
ServiceTS is an invisible VB.Net programme with 'ServiceTS' in the header...
FindWindow$1 "" "ServiceTS"
>IntCmp $1 0 done
IsWindow$1 0 done
SetOverwrite try
>done:
Thx
Freezerman350
31st March 2005 16:42 UTC
So, maybe i forget to write : My program dont work
My setOverwrite is always set at TRY
thx
can you help me ?
kichik
31st March 2005 18:34 UTC
SetOverwrite is not a regular instruction, it's a compiler flag. It affects everything used beneath it.
It seems like you're trying to not override the executable if it's in use. If this is the case, why not use SetOverwrite off?
Freezerman350
31st March 2005 18:54 UTC
this is not the case
ServiceTS is an another program...
during the installation of y principal program, i wanna check if ServiceTs is running on the computer, that will tell me if the computer is a terminal server or not...
because, we already install serviceTS on each Terminal server 2000 and 2003
so it is possible to check if ServeceTs is running, if yes, turn un try the "setoverwrite" option if not, turn off the "setoverwrite" option
Thx !!!
:-)
Freezerman350
31st March 2005 18:57 UTC
In my code
FindWindow$1 "" "ServiceTS"
>IntCmp $1 0 done
IsWindow$1 0 done
SetOverwrite try
>done:
I try to skip the setOverwite operation if the program ServiceTS is running...
kichik
31st March 2005 19:27 UTC
You'll to include two File commands, one for each SetOverwrite value. Don't worry about size, the datablock optimizer will make sure the executable is only included once.
Freezerman350
31st March 2005 19:34 UTC
I'm not sure to understand....
can you give me a exemple.... sorry to disturb
Thx...
kichik
31st March 2005 19:39 UTC
!include "LogicLib.nsh"
#...
${If} $0 == 'found'
SetOverwrite try
File file.exe
${Else}
SetOverwrite off
File file.exe
${EndIf}
Freezerman350
31st March 2005 19:45 UTC
exemple : ???
FindWindow$0 "" "ServiceTS"
>${If} $0 == 'found'
SetOverwrite try
;
ALL THE FILE A WANT TO INSTALL...
File file.exe
...
${Else}
SetOverwrite off
;ALL THE FILE A WANT TO INSTALL...
File file.exe
...
${EndIf}
Freezerman350
31st March 2005 20:09 UTC
FindWindow $0 "" "ServiceTS"
${If} $0 == 'found'
"found" never append.....
maybe the program dosent return found..
Freezerman350
31st March 2005 20:49 UTC
also..."setoverwrite" = off change nothing
the porgram skip the "found" section and stay with the TRY position...
Freezerman350
31st March 2005 21:21 UTC
Somebody can explain how to use findwindow first....
secondo...my setoverwirte and my code dont work....
can i use more than one "setoverwrite" ?????????
if is a compilation flag the answer is no !
so ???
someone understand ?
kichik
1st April 2005 11:09 UTC
!include "LogicLib.nsh"
#...
FindWindow $0 "" "ServiceTS"
${If} ${Cmd} "IsWindow $0"
SetOverwrite try
File file.exe
${Else}
SetOverwrite off
File file.exe
${EndIf}
Freezerman350
1st April 2005 15:32 UTC
i try your code
>!include "LogicLib.nsh"
>#...
>FindWindow $0 "" "ServiceTS"
>${If} ${Cmd} "IsWindow $0"
SetOverwrite try
File file1.exe
>${Else}
SetOverwrite off
File file2
.exe
>${EndIf}
work great file1.exe copy on my directory if ServiceTs is running or else i got a copy of file2.exe
:-)
BUT, whatever the path(if or else..)... "SetOverwirte" is always at "try"... "auto skip file"
got an idea?
Freezerman350
1st April 2005 16:05 UTC
i try SetOverwrite on instead of SetOverwrite off
WORK