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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy files using custom actions in Setup Project

Status
Not open for further replies.

MZwijacz

Programmer
Jun 27, 2002
33
US
I have a project to deploy but there is a file (non code), that will need to be copied to a directory on the install machine, that is not the app dir. To make maters worse, this directory will be different on every machine. So I can not use the File system editor.

My thinking was to use a custom action on the Install_AfterInstall event. This action would look in the application directory where that app had just been installed and copy this file to a specific dir on the users machine. The problem is this dir could be anywhere on the users machine. The good news is the dir will always be named the same.

How do I get the app dir name so I can copy this file at the end of the setup process ? Will the file exist on the install computer during the Install_AfterInstall event ?



Thanks,

MFZ
 
The information about installed application is stored in windows registry with this following path:
Code:
HKEY_CLASSES_ROOT\Installer\Assemblies

Its subkeys will list the absolut path of installed application, at least when using the MS setup wizard.

One of the subkeys should look like:
Code:
C:|Program Files|MyApp.exe
Be aware of the pipe string "|" in the subkey names.

Regards
 
Thanks I will give it a try today, and let you know how it went.

MFZ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top