How can I make a launcher exe, that runs a batch file that opens another process and in that process it injects a specific dll after a certain time? - automation

I'm trying to work on something that auto restarts an application that runs matches and crashes itself (purposefully) in order to rerun that application. I would like a simple executable that would be running a batchfile that opens that application, and then after that application finishes loading, it injects a dll.

Related

How to launch a readonly "copy" of a VB Windows Form application

I'm developping a simple application in Visual Studio in VB.NET language. I say simple because it doesn't need any install, it's a standalone exec file. This programm is stored into a network location to make it available to all employees of my company, but I'm working regularly on it, and the problem is that if anyone is using this app (launched from network), I can't replace file because it is currently used.
Is there any way in VB to launch a Windows Form application with its .exe and make this file still available for any modification?
I've solved a similar problem like this:
each user has it's own copy of exe
when the program is launched (or in a timer loop) compare network file modified date (or version number or some other flag) with local copy
if network file is newer, notify user that there's a new version available to download
(conditionally) start a small helper program which copies new files to local folder, close current exe and launch it from downloader (helper) again after it copies all new files

Test VB.Net Application as if Vb were not installed

I have created a VB.Net application that I plan to distribute using the .exe file in the Release folder. Upon sending this to a user, I was informed that it would not run on their system. The exe runs fine on my system no matter the location of the file so it's not a folder dependency. I don't have easy access to another computer, so is there an easy way to test my file as if visual basic were not installed on my system?
Edit: By "does not run" I mean nothing occurs when the exe is clicked

Multiple runtime exceptions when clicking run from task scheduler. Works fine running the application from the project folder?

So I wrote a VB.net project in Visual studio. I have a scheduled task that is set to run the program every morning at 10AM.
If I use windows explorer and double click the application, it runs fine.
If I open task scheduler, open the task properties, and browse to the application, then choose run, the program fails, due to Runtime exceptions.
I know I have the path entered correctly, since I can debug the instance when it crashes from the task scheduler. VS2010 pulls up my source code...
Any Ideas?
I feel like I've tried everything..
Update
The exception is System.IO.FileNotFoundException, remember, it works fine when I double click the app. If attach a debugger to the process after it is executed from the task scheduler, I can then restart the debugger, and Voila!, The application runs fine.
When you create a task, under the "Edit Action" properties, there is a field "Start In (Optional)" It is not optional. It is critical this is populated with the path to the program you are executing. if it is not your scheduled task will fail... It seems redundant but it fixes the issue.
Thanks Microsoft.

I am looking for information to make my windows form app self updating

I would like to make my windows form app self updating when it starts. Where can I find good information for that?
I am using Visual Studio 2008 VB.NET.
I like the click once approach. With this application I have an access db as the backend datastore. When the application self updates how can I be sure the mdb file is not overwritten?
What is the best way to self upgrade the mdb if their is a change to the mdb file but not loose the data?
If you deploy using ClickOnce, you get this functionality for free. I do not have any experience with this (yet), but I can point you to an article.
I have been using Click Once for years with very little problems.
I've written a custom automatic updater and basically, the way it works is this:
The whole application is essentially 3 parts:
A launcher .exe that's essentially like a bootstrapper
The launcher .exe has an embedded .exe resource that is used if the launcher .exe itself needs to be updated
The application dll's
When you start the application, the launcher app starts and checks via webservices if the dll's are up to date. If they are not, it downloads them to a temporary directory and then makes sure the checksums are all correct and overwrites the existing app libraries with the new ones. It's then loading the application's core assembly and calls a "Run" method via reflection.
Now, in our app we sometimes have the need to update the launcher itself and the way we achieved this is by embedding an .exe in the launcher .exe resources. If the launcher detects that there is a new launcher .exe available, it downloads it to a temp directory, then extracts the .exe and launches it. This extracted .exe simply shuts down the launcher process, copies the new launcher .exe over the old one and then starts the launcher process again.

Debugging DLL Called With CeRapiInvoke

I'm trying to debug into a C dll that is invoked on a Windows Mobile device using CeRapiInvoke() (Technically RAPI.Invoke() from OpenNETCF) from a Windows box. I'm very familiar with attaching to a process that is already running to debug a loaded dll (I've done it many time with Windows Mobile services) but I can't seem to figure out what process is actually running the dll. Even when running the Remote Process Viewer I don't see any new processes pop up, so it must be something that is already running... Any ideas as to which process to attach to in order to debug into the dll when invoked?
Edit: After trying to attach to several different processes I found that it was "rapiclnt.exd" that did the trick.
rapiclnt.exe is the process which loads the RAPI dlls. Read this for more on debugging RAPI dlls.
http://knowledgepointer.wordpress.com/2008/11/08/debugging-rapi-dlls/