|
-
Oct 16th, 2006, 05:54 PM
#1
[RESOLVED] Custom Action Problem
Hi.
I have a solution that has a application project and a setup project.
The problem i have is that i want after the installation to do some exta stuff.
I create a new ClassLibrary project and i add an classinstaller. Now the problem i have is on how to make this installer to run after the installation of my original program. When i tried to add the Dll of the installerclass to the commit custom action, i get the error "Could not find file d:\xxxxx\ClassLibrary1.Installstate.
Am i doing something wrong? I also did "setup-add-project output" and selected all the classlibrary1 output.Then added it on the commit custom action but the problem is there.
I have to say tha i used my code inside the installer of the classlibrary1, after "InitializeComponent()"
.
-
Oct 16th, 2006, 05:58 PM
#2
Re: Custom Action Problem
-
Oct 16th, 2006, 06:27 PM
#3
Re: Custom Action Problem
I found that the InstallState file needs to be created on one of the Install events so that it can be found when you handle one of the Commit events. Add an empty event handler for BeforeInstall or AfterInstall and it should create the InstallState file that will then be found in the Committing or Committed event handlers. You should also add an empty event handler for AfterUninstall so that the InstallState file will be deleted if your app is unistalled.
-
Oct 16th, 2006, 06:33 PM
#4
Re: Custom Action Problem
I have read the exact article before but unfortunately i does not explain how to handle 2 projects.
How exactly do i add an empty output on the Install,before etc actions!?
Also i could make it simpler for you:
I have an exe file that i want to run at the custom_action-commit phase.
Can i do that and how?
-
Oct 16th, 2006, 06:48 PM
#5
Re: Custom Action Problem
You've already added an event handler for one event. Adding a handler for other events is done exactly the same way. You then just leave the generated methods empty.
Having said that, if you want to run an executable then you don't need any installer classes at all. When you tell the IDE to create a custom action you simply select the file you want executed. If you don't set its InstallerClass property to True then it will simply be run as a normal executable without looking for an installer class and its corresponding event handlers. That means that you must add this executable to your setup project so that it can be selected when you want to add a custom action.
-
Oct 16th, 2006, 07:09 PM
#6
Re: Custom Action Problem
I've tried adding handlers for the other actions but it does not work.
It only works if you put the SAME handler on all the actions.
The executable idea works and i thank you for that.
One last thing.
If i put an executable in the commit action and this executable requires a dll to function then just adding the dll to the setup project will work?
Thanks.
-
Oct 16th, 2006, 07:11 PM
#7
Re: Custom Action Problem
If i put an executable in the commit action and this executable requires a dll to function then just adding the dll to the setup project will work?
Assuming that the library is in the same folder as the executable then yes.
-
Oct 16th, 2006, 07:21 PM
#8
Re: Custom Action Problem
Mmm.
But i think that when you add the exe to the setup it does not look back on witch folder you added it from. Ok because i've trouble you enought, let's say i bring the dll to the same folder as the exe and then add them both on the setup. Will that be ok?
-
Oct 16th, 2006, 07:37 PM
#9
Re: Custom Action Problem
It doesn't matter where they are on your machine, only where they are on the machine on which they're being executed. I've never tried this with an executable that wasn't installed in the proam folder, so I don't know all the variations. If you have your setup install both the EXE and the DLL to your program folder then you'll have no issues. Other than that I can't say.
-
Oct 16th, 2006, 07:39 PM
#10
Re: Custom Action Problem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|