Click here to Skip to main content
15,891,865 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

I'm not a programmer, so this may sound ridiculous. I'm trying to write an .exe that simply swaps out one of the .dll files in the program files directory. This would serve as a simple patch for users that already have a certain piece of software installed and just need the .dll updated. Can this be completed using iexpress? Thanks in advance for any help!

Matt
Posted
Updated 8-Mar-13 12:25pm
v2
Comments
Sergey Alexandrovich Kryukov 8-Mar-13 18:26pm    
Not clear. What do you mean by "swapping out" a DLL? Why? Make a patch out of what? Do you have the DLL source code?..
—SA
Member 9895545 8-Mar-13 18:32pm    
Thanks for the quick reply. Swapping out a DLL meaning removing the old one and adding in a new one. The code in the DLL is irrelevant, I just want to replace the DLL that currently exists in directory with an updated version. The EXE I am attempting to create would serve as a "patch" to the existing software. I realize this seems unnecessary because any user with admin rights could just copy and replace the old DLL with the new one. However, this entire process needs to be automated, which is why I need to build an EXE to handle this simple task.
Sergey Alexandrovich Kryukov 8-Mar-13 19:24pm    
Wait a second. Why EXE? This is just the upgrade, which is done nearly anywhere. I hope you are not trying to upgrade anything while running the application, is that right?..
—SA
Member 9895545 8-Mar-13 21:50pm    
No the application will not be running when upgrading. I guess EXE is the wrong approach. Apologize for my ignorance here. What is the best way to handle this?
Sergey Alexandrovich Kryukov 8-Mar-13 22:45pm    
Not problem at all. This is nothing but upgrade. It depends on how the deployment is made.

The best deployment method (not always applicable, unfortunately) is just copying the project output to target computer. After many years of development, Microsoft started to encourage it (at least for .NET). In the upgrade, the user either delete all files or overwrites them with new ones. So, first of all, you need to understand why not using this simplest approach.

Next level would be using MSI...

—SA

1 solution

This is something that can be done via a Batch file.
1. Open Notepad
2. Write: 'copy <full path="" of="" new="" dll=""> <full path="" of="" old="" dll="">
for example: copy c:\program files\mysoftware\mynewdll.dll c:\program files\mysoftware\myolddll.dll
3. Save as 'replacedll.bat'

Then when you double click 'replacedll.bat' it will do the work
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900