Archive: About FindWindow


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

So, maybe i forget to write : My program dont work

My setOverwrite is always set at TRY

thx

can you help me ?


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?


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 !!!
:-)


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...

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.


I'm not sure to understand....

can you give me a exemple.... sorry to disturb

Thx...


!include "LogicLib.nsh"
#...
${If} $0 == 'found'
SetOverwrite try
File file.exe
${Else}
SetOverwrite off
File file.exe
${EndIf}

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}

FindWindow $0 "" "ServiceTS"
${If} $0 == 'found'

"found" never append.....
maybe the program dosent return found..


also..."setoverwrite" = off change nothing
the porgram skip the "found" section and stay with the TRY position...


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 ?


!include "LogicLib.nsh"
#...
FindWindow $0 "" "ServiceTS"
${If} ${Cmd} "IsWindow $0"
SetOverwrite try
File file.exe
${Else}
SetOverwrite off
File file.exe
${EndIf}

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?

i try SetOverwrite on instead of SetOverwrite off


WORK