Click here to Skip to main content
15,905,781 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,

Changing [TARGETDIR] in Installer Class...
Posted
Comments
JITHIL P PONNAN 1-Dec-12 4:28am    
Is this a question or just some quotes?????

Please don't spoil this site's quality.

1 solution

You shouldn't be doing that unless you have a damn good reason to do so. Changing the TARGETDIR at the wrong time during an installation can break your app installation AND make it impossible to uninstall.

You have to keep more than a few things in mind when doing this. You can't just assume your installer wil ever be used to do just an install. There are also Admin installations, Maintenance (Repair) installs, and Uninstalls. Changing the TARGETDIR for an Install doesn't necessarily mean that the same method you use for changing the TARGETDIR during install is going to get executed during the other uses for your installer.

Read this[^].

If you really are going to process to do this, DO NOT DO IT using the Setup project in Visual Studio. Use a professional installation package builder project, like InstallShield.

Oh! And another thing. You also have to consider the possibility that your app is being installed/maintained/uninstalled on a 64-bit machine where the Program Files folder can have a different name depending on the bitness of your installer/app.
 
Share this answer
 
v3

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