DetourCreateProcessWithDllEx replacement - hook

I am trying to hook detours dll into my application it works but my application launches another exe. I can't attach to that exe because it says launch previous application and closes.
What I am trying to ask is, is there something in detours API that allows me to hook onto a process?

Related

Listen for linux command in a Qt app running in background?

I wonder if there is a way to send data from an OS command (Linux to begin with, but I would be interested about Windows too) to a Qt app working in background.
My use case would be to right click in a context menu in a file explorer and then send the path of the selected file(s) to the already running Qt app to trigger an action inside that app.
Can anyone provide some explanations or a link to an example achieving that ?
I already read about adding right click in Nemo/Nautilus with some custom config files, I am more interested by the Qt part.
AFAIK, there is no such component available with QT. (Don't know if anything added recently, I haven't used qt from long time)
But what you can do is write some code in qt app like server ( May be socket server OR pipe), when some data comes on that you can take action based on that data value.
On other side write some small utility which will get called, which send data to you server, with path of selected file when clicked via context menu.

Electron shell.openExternal can't open some .lnk shortcuts

I'm creating a launcher using electron. It launches applications and files in my Windows system using the shell.openExternal command.
It works well when I call shell.openExternal passing .lnk shortcuts as parameters, but when I call some apparently equal shortcuts created by, for example, GoG installers, the game is not launched and I can't debug what happens. I know that the shortcut is called but the target application crashes. I got this message from Lichdom: Battlemage launcher:
Witcher 3 also fails, nos message is displayed. When I call these shortcuts directly from the system, they work fine. If I manually create an apparently exact same shortcut to the same file, it launches normally in both electron and the explorer.
Any ideas what could be happening or how to debug?

Inno Setup: Shutdown service for custom page

I'm building an installer using Inno Setup where I need to convert some existing files if the application is already installed.
To do so I need to stop the applications service which works automatically for the install process. Is there a way to hook a page between the application shutdown and start routine? Or to postpone the application restart to a later time?
EDIT:
I also tried CheckForMutexes('MyAppMutex') to manually prompt the user to close the application, but the function always returns false.
EDIT2:
My current workarround uses the isProcessRunning script by jakoch to prompt the user to manually close the application. I would prefer a more automatic solution though.

How to execute a setup from an application to update it?

I'am currently writing an application that has to search on a web site if an update exists for this application. If it is the case the application download a setup file (created with inosetup) and then execute it.
My application is written in C++. And I do not arrive to do this process. I'am trying to call the setup using system(). If the command is system("mysetup") I cannot obtain what I want because the setup cannot replace the exe (currently running). So, I have tried to use system("cmd /C mysetup"), system("cmd/C start /min mysetup"), system ("cmd /C start /min /separate mysetup") without success. In these cases, the fact to stop the application also stop the setup. So I suppose that the setup is considered as a child process.
I have seen in some posts that it might be possible to use execcl(). But this function is in unistd.h. And this library is a little bit to specific for my needs (I need to be able to run on virtualized windows).
So do you have a way to do what I want?
Thanks for your help
OK,
A colleague to me gave me the solution. As we are using QT a QProcess::startDetached does exactly what I want.

How does one start a process from CruiseControl .NET that persists after CC .NET exits?

I have a program that normally runs constantly. Whenever there is a new checkin to Subversion, CC .NET kills the program and makes a new build. I want to start a new instance of the program from CC .NET.
Right now, if I use <executable>, then CC .NET hangs while it waits for the process to end, which will never come by definition.
As far as I know there is no way to get CC.NET to launch something without it getting a return value and not have an exception. So to get around this my first thought would be to use the executable task to call some form of script, which can then launch the exe and return back to CruiseControl.

Resources