You can use NSIS (free and open-source). It's very flexible, yet it can be used for such simple tasks, too (and it has served me well in such cases). Assuming your files are named yourapp.exe
and yourlib.dll
, you could use this script:
# this will be the created executable archive
OutFile "archive.exe"
# define the directory to install to, the installer's directory in this case
InstallDir $EXEDIR
# don't create a window for the unarchiver
# You could get fancy and do all kinds of configuration
# in the non-silent install; this example is the simplest it can be.
SilentInstall silent
# the executable part
Section
# define the output path for the following files
SetOutPath $INSTDIR
# define what to install and place it in the output path...
# ...your app...
File yourapp.exe
# ...and the library.
File yourlib.dll
# run your application
ExecShell yourapp.exe
# done
SectionEnd
Install NSIS, create this script as archive.nsi
, right click it and select "Compile with NSIS". The file archive.exe
will be created.
Then, on the target system, all the user needs to do is launch archive.exe
; the script will unpack and run your program.
(If you want to get fancy, you can look into the tutorials that are installed with NSIS, or see this page.)