Coding A Custom Action For My Setup Project?

247 Views Asked by At

This is the first time I've gotten a piece of software ready for distribution. I'm currently working on a setup project to create the installer and I need to write a custom action to add an entry to he PATH Environment Variable.

My question is: Is a Custom Action a separate project from the Setup Project or can it be added and written within the setup project? Also, what libraries would I be using to write this?

This is the project I used: enter image description here

Thank you in advance for any of your time! I can't figure this out for the life of me.

--UPDATE--

I clicked on View > Registry and added "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" with a string-value called path. I entered [TARGETDIR] as the value and build the installer. After installation, Environment variables are still not added to my system.

-Kepler

1

There are 1 best solutions below

2
On

If memory serves me well, the stuff like implementing env.variables, changes registry keys etc. is the simplest you can do by using setup project. The more complicated scenarios may include IIS deployment, the environment configuration etc. Not sure what VS version is this in the screenshot but I had a quite sad practice where setup projects from the previous VS version were incompatible with new ones. I would use something like AdvancedInstaller, please see the features here: http://www.advancedinstaller.com/features.html