all groups > dotnet setup > july 2006 >
You're in the

dotnet setup

group:

Exclude custom action .exe


Exclude custom action .exe Lonifasiko
7/20/2006 4:20:43 AM
dotnet setup:
Hi, after my setup project copies all necessary files to the target
directory selected by the user, I'm launching a little Console
application that moves some files to %USERPROFILE% directory. Besides,
I write application's configuration file (application.exe.config) with
the new path of these moved files.

I think this is the only way I can move these files to %USERPROFILE%
directory. But this should depend on what radiobutton user selects
during installation (install "Just for me" or "For all users").
That is, sometimes I should copy these files to %USERPROFILE% whereas
sometimes I should copy them to %aALLUSERSPROFILE%. How can I do this?
Can I use any environment variable in a Custom Folder that lets me do
this? What properties should I change then?

Well, back to my current situation, where I launch a .exe as a custom
action. The executable I'm launching during installation, is copied to
the target directory of the application, that is, I can see the .exe.
This way installation works fine. I've tried with "Exclude=true" in
order to launch my cutom action but do not copy the console
application, but this way installation crashes.

Besides, when launching the console application, I can see the console
window for some seconds. Is there a way to avoid this during
installation process?

I would really appreciate any light on this. Thanks very much in
advance.
Re: Exclude custom action .exe Phil Wilson
7/20/2006 6:13:23 PM
The property ALLUSERS has a value of 1 when installing per-machine, so the
condition on your custom action that you want to run for a per-machine
install is ALLUSERS=1. Use ALLUSERS<>1 for the opposite condition.
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

Re: Exclude custom action .exe Lonifasiko
7/21/2006 4:21:33 AM
Thanks very much. I'll try then, but I also needed to know if it's
possible to exclude the executable file I run in my custom action. That
is, execute it but not copy it in to the application's folder. I'm
afraid it's impossible.....am I wrong?

Regards.
Re: Exclude custom action .exe Phil Wilson
7/21/2006 9:28:13 AM
If you add the exe as a custom action in the application folder it will also
show up in the solution explorer view. Right-click->Properties there will
show you an Exclude you can set. Note that it will run from a temp folder,
not your application folder.
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

Re: Exclude custom action .exe Phil Wilson
7/21/2006 2:04:24 PM
As ar as I can tell, a setup with managed code custom action exes won't
build if Exclude is true, but if it's an unmanaged exe it will build with
Exclude=True. I have no idea why managed custom action exes are different
here.
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

Re: Exclude custom action .exe Lonifasiko
8/1/2006 11:03:55 PM
Thanks Phil for your replies.

As you say, my auxiliar console application (managed code) has no
success when setting Exclude=True. Therefore, I'll have to let it in
the application folder "forever", or have to remove it manually later
on, after installation.

A little bit "dirty" but seems to be the unique way for avoiding having
this additional .exe in the application's directory.

Thanks very much.
Re: Exclude custom action .exe Phil Wilson
8/2/2006 2:02:27 PM
If you remove it after installation keep in mind that if the product install
goes into repair mode it will just get reinstalled.

--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

AddThis Social Bookmark Button