This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: installing/uninstalling a service through custom actions
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Aug 21, 2007
02:33 PM
installing/uninstalling a service through custom actions
Hi.
I have 4 custom actions for a service I want to install:
install, start, stop, uninstall. I also have a batch file for each task (install, start, stop, uninstall).
What is the correct syntax for getting my custom action to run the batch file? I can't run it directly because it isn't an .exe, and I tried making my actions look in the system folder, and the "target" was this, for example:
cmd.exe [INSTALLDIR]stop.bat
When I run my install package, it installs, but doesn't install the service (and I see no error messages or command prompt pop-ups). When I try to "remove" my install from add/remove programs in control panel, it brings up a command prompt with nothing entered, and after I close it, I get an error with my "stop" action.
However, if I run my install package rather than removing it from add/remove programs in control panel, and select the "Remove" option, it removes everything just fine, with no errors, and no command prompt pop-up.
Oh, the sequence and conditions for my actions:
install: AfterInstallServices; Not Installed
start: AfterStartServices; Not Installed
stop: AfterStopServices; REMOVE="ALL"
uninstall: AfterDeleteServices; REMOVE="ALL"
Can anyone offer some advice?
I have 4 custom actions for a service I want to install:
install, start, stop, uninstall. I also have a batch file for each task (install, start, stop, uninstall).
What is the correct syntax for getting my custom action to run the batch file? I can't run it directly because it isn't an .exe, and I tried making my actions look in the system folder, and the "target" was this, for example:
cmd.exe [INSTALLDIR]stop.bat
When I run my install package, it installs, but doesn't install the service (and I see no error messages or command prompt pop-ups). When I try to "remove" my install from add/remove programs in control panel, it brings up a command prompt with nothing entered, and after I close it, I get an error with my "stop" action.
However, if I run my install package rather than removing it from add/remove programs in control panel, and select the "Remove" option, it removes everything just fine, with no errors, and no command prompt pop-up.
Oh, the sequence and conditions for my actions:
install: AfterInstallServices; Not Installed
start: AfterStartServices; Not Installed
stop: AfterStopServices; REMOVE="ALL"
uninstall: AfterDeleteServices; REMOVE="ALL"
Can anyone offer some advice?
(4) Replies
‎Aug 21, 2007
05:34 PM
Are the actions scheduled for deferred execution (I believe immediate execution is the default)? In general, actions that modify the target system should be marked for deferred mode. You might also verify that the uninstall actions aren't scheduled after RemoveFiles.
(As an aside, is using the standard actions for manipulate services out of the question? If you can use those, you don't need to worry about rollback, uninstallation, and all that.)
(As an aside, is using the standard actions for manipulate services out of the question? If you can use those, you don't need to worry about rollback, uninstallation, and all that.)
‎Aug 22, 2007
11:11 AM
RobertDickau wrote:
In general, actions that modify the target system should be marked for deferred mode.
Thank you very much! This was the problem. It works now.
As an aside, is using the standard actions for manipulate services out of the question?
Just out of curiosity, what & where are the standard actions?
Thanks again for your help!
‎Aug 22, 2007
11:13 AM
The standard ones are the actions near your custom actions: InstallServices, StartServices, and the rest. You can get to the associated standard tables in a component's Advanced View, and the Component Wizard (right-click a feature in the Setup Design view) can help you get the data in there...