Archive: 2 questions


2 questions
1. I would like to make my installer copy itself into the destination folder in the event it was launched from someplace else. I used CopyFiles, it didn't work. Is this possible?

2. From my installer, how can I detect if my application is open so I can warn the user to close the app before attempting to reinstall it.Currently I get a crash if the user attempt to install while the app is open.

Thanks


1.

System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
#returns installer exe file name
CopyFiles "$EXEDIR\$R0" "$INSTDIR\$R0"


2. You could use FindWindow, or you could use a system call to find if your program's mutex exists.
See FindWindow in the documentation, and search this forum for mutex.

-Stu

Thanks, this was helpful.