Page 1 of 1

Uninstall Using .NET installutil.exe

Posted: Wed Dec 22, 2010 11:08 am
by pointeman
I've been installing\uninstalling .NET services successfully using the installutil.exe.

Q. Should I also use the IA9 "Control Service" before running the installutil /u command line tool?

Re: Uninstall Using .NET installutil.exe

Posted: Wed Dec 22, 2010 11:14 am
by giaviv
Dear pointeman,

If you have been successful at installing/uninstalling .NET services with installutil, just keep using it. The control service practically does the same thing.

Good luck,
Aviv Giladi
InstallAware Support

Re: Uninstall Using .NET installutil.exe

Posted: Wed Dec 22, 2010 12:11 pm
by pointeman
Thank you :)

Re: Uninstall Using .NET installutil.exe

Posted: Thu Dec 23, 2010 7:13 am
by giaviv
Dear pointeman,

I missunderstood your question. I thought, for some reason, that you are referring to sc.exe...
Control Service simply controls a service. installutil.exe is something else, and its equivalent to InstallAware's Run .NET Installer
Class.

Thanks,
Aviv Giladi
InstallAware Support

Re: Uninstall Using .NET installutil.exe

Posted: Thu Dec 23, 2010 11:38 am
by pointeman
I've been using this code successfully within IA9:

~InstallAware Clipboard Data~
~Run Program~
~{85501840-E659-4726-AC5D-F79E8B7E7864}~
~$WINDIR$\Microsoft.NET\Framework\v2.0.50727\installutil.exe~
~TRUE~
~/u "$TARGETDIR$\OurProdName\OurAssemName.exe"~
~TRUE~
~~

Q. You saying that "Run .NET Installer Class" is good if not better than using installutil?

~InstallAware Clipboard Data~
~Run .NET Installer Class~
~{DF3C81E0-651F-4A5A-9930-30C81F5BC9B3}~
~$TARGETDIR$\OurProdName\OurAssemName.exe~
~TRUE~

Q. I'm assuming I can successfully use variable $TARGETDIR$\... as used above?

I'm asking because the "Run .NET Installer Class" (MSIcode view) has a browse button that looks for assembly on pc drive, not internal IA9 project directory folders....

Re: Uninstall Using .NET installutil.exe

Posted: Thu Dec 23, 2010 12:38 pm
by giaviv
Dear pointeman,

The Run .NET Installer Class is a wrapper of installutil.exe, so it basically functions the same. Again, user whatever works for you.
When you add a "The Run .NET Installer Class" you can, instead of browse a file, just enter $TARGETDIR$\OurProdName\OurAssemName.exe. That worked for me when I tried it here - let me know if it does for you.

Best,
Aviv Giladi
InstallAware Support

Re: Uninstall Using .NET installutil.exe

Posted: Thu Dec 23, 2010 3:21 pm
by pointeman
Yes, installed very smooth, but did not start service 'on install'.
1. Folders are created
2. Files are installed
3. Program "UpdaterGui" is forced to run.
4. No "Updater" service is running, but it is installed correctly.
5. Also coded "Control Service" to get it to start, but still not running...

Note: Please delete this code when done if you see any personal info of mine....

[DEFINE REGION: Perform First Time or Maintenance Installation]
Comment: Install/Re-Install product
Create Shortcut $TARGETDIR$\Updates\Uninstall #TITLE# to $UNINSTALLLINK$
[DEFINE WEB MEDIA XXXXXXXXXXXXXXXXXXXXXXXXXXX
Install Files XXXXXXXXXXXXXX
[OFFLINE CONTENT]
Get Component XXXXXXXXXXXXXXXXX Selection State into Variable SELECTED
if Variable SELECTED Equals TRUE
end
Comment: TO-DO: Insert any additional install commands here
[compiler if Variable BUILDMODE Equals PATCH]
Apply Patch (get result into variable SUCCESS)
[compiler else]
if Variable ADVERTISE Equals TRUE
Apply Advertised (get result into variable SUCCESS)
else
Create Folder $TARGETDIR$\Updates
Create Folder $TARGETDIR$\Updates\Logs
Apply Install (get result into variable SUCCESS)
if Variable SUCCESS not Equals ERROR
if Variable SUCCESS not Equals CANCEL
Run .NET Installer Class $TARGETDIR$\Updates\Updater.exe
end
end
end
[compiler end]
Set Variable PROGRESS to 100
end
<<Code Folding Region>>
<<Code Folding Region>>

[DEFINE REGION: Finish Setup]
Comment: End of Installation
Hide Dialog
Display Dialog: finish, wait for dialog to return (modal)
if Variable SILENT Equals FALSE
if Variable REBOOTCOMPUTER Equals TRUE
if Variable SUCCESS Equals REBOOT
Reboot Computer
end
end
if Variable RUNAPP Equals TRUE
if Variable REMOVE Equals FALSE
if Variable SUCCESS Equals COMPLETE
Run Program $TARGETDIR$\Updates\UpdaterGui.exe
Control Service Updatersvc: start on install
end
end
end
end
<<Code Folding Region>>

Re: Uninstall Using .NET installutil.exe

Posted: Thu Dec 23, 2010 5:13 pm
by giaviv
pointeman,

What exactly are you trying to achieve? Are you trying to run a service or to install an assembly?

Thanks,
Aviv Giladi
InstallAware Support

Re: Uninstall Using .NET installutil.exe

Posted: Thu Dec 23, 2010 5:33 pm
by pointeman
Install & start the service after install. Install is fine, just will not start upon IA9 completion.

Re: Uninstall Using .NET installutil.exe

Posted: Fri Dec 24, 2010 2:04 am
by giaviv
Dear pointeman,

The code looks fine to me. The question is whether the Updater.exe successfully installed the Updatersvc service. What I would do is first of all debug the installer and see if it does indeed install successfully. You can run the following command in your cmd: "sc query Updatersvc" - that will tell you if your service (installed) and its status. If the installation fails to run it, try running "sc start Updatersvc" - if that fails, there might be a problem with your service that is causing it not to run. Please try this and update me on the result.

Best,
Aviv Giladi
InstallAware Support

Re: Uninstall Using .NET installutil.exe

Posted: Thu Dec 30, 2010 2:21 pm
by pointeman
Okay, I've been tesing the IA9 install and find the service (Updatersvc) IS definitly installed upon the last IA9 'Finish' dialog.

1. The 'Run Program' method works great...
2. The 'Control Service' method does NOT start the installed service (Updatersvc)...

Here's my final code in the IA9 msi...

[DEFINE REGION: Finish Setup]
Comment: End of Installation
Hide Dialog
Display Dialog: finish, wait for dialog to return (modal)
if Variable SILENT Equals FALSE
if Variable REBOOTCOMPUTER Equals TRUE
if Variable SUCCESS Equals REBOOT
Reboot Computer
end
end
if Variable RUNAPP Equals TRUE
if Variable REMOVE Equals FALSE
if Variable SUCCESS Equals COMPLETE
Run Program $TARGETDIR$\Updates\UpdaterGui
Control Service Updatersvc: start on install
end
end
end
end
<<Code Folding Region>>

Re: Uninstall Using .NET installutil.exe

Posted: Thu Dec 30, 2010 2:27 pm
by giaviv
Dear pointeman,

Just to see if your service even works outside of IA, try running "sc start YOURSERVICENAME" in cmd.exe or Start -> Run and tells me if the service starts successfully. It is possible that a service is installed but fails to run. If the service is run successfully please send me your project for inspection (either attach here or email to [email protected])

Thanks,
Aviv Giladi
InstallAware Support

Re: Uninstall Using .NET installutil.exe

Posted: Fri Dec 31, 2010 2:52 pm
by pointeman
Here's my solution that works great. Also, 'Hide Program Window'

Run Program $WINSYSDIR$\net.exe start myservicename