Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows 7 Taskbar Grouping

Status
Not open for further replies.

Borvik

Programmer
Jan 2, 2002
1,392
US
This is a bit advanced, and I'm not certain what I'm looking to achieve is even possible.

I have a 3rd party application (no source code, or ability to change it except via plugins), and I have written some plugins for it.

When my plugins have updates, I have to manually go to each users machine and replace the plugin files.

Many users already have shortcuts to this 3rd party application (say "C:\App\app.exe config.ini" - yes it's passing in an argument for configuration).

To make this program auto update, I have renamed app.exe to app_launcher.exe and created a new app.exe that checks for new plugin files and copies them over - then launches app_launcher.exe with the passed arguments. The procedure works great.

Users however have pinned the original shortcut to their taskbar, and now my updater runs under that icon while the final app_launcher.exe shows up under a new icon. It's understandable because its a different app, but it's also an undesirable behavior.

I have found that supposedly this could be resolved by the two applications using the same AppUserModelID. This has been somewhat problematic since I didn't have code for the 3rd party app.

Using the WindowsAPICodePack I was able to set the AppUserModelID for the updater application, and after some time I passed it on to the original application via CreateProcess (kernel32.dll reference).

Is what I'm looking to do even possible? If so, how? I do NOT want to install another 3rd party app to handle this.

Thanks!
 
I think I may have found a solution, though it's a bit of a hack.

The problem comes from having the final application not matching the shortcut being run.

So rather than replacing the EXE and running the real one when done, I made sure the updater application would always run before the real exe.

The only caveat is that it also runs for EVERY exe on the system (via HKCR\exefile). The first parameter is now the path to the true executable, which if it matches the application it runs the updater. Once the updater finishes or if it is any other app, it runs it.

Not an ideal solution (as it could be detected as malware), but it should work for us.
 
Nope - this won't work as it prevents some system exe's from running. Most notably msconfig.exe.

I had my updater program checking if the exe existed before running it, and throwing up a message box if it didn't. Somehow even though the C:\Windows\System32\msconfig.exe did exist, my program insisted it did not.

Back to the drawing board.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top