Discussion:
Windows Installer
(too old to reply)
Allan Phillips
2007-08-24 18:45:01 UTC
Permalink
I'm sure that this isn't the right group but I cannot figure out whether
there is a right one.

I have a Win32 application that I've built an install set for using VS-2005.
The install seems to work just fine putting all the files in the right place
alright.

However, I would now like to alter one of the files during the install
process. Once the user has selected a folder to install into I need to
store that folder's name in a text file that came from the install set.

What is the correct way to do that? Is there a way to script that or is one
supposed to create a DLL or EXE to do that bit of work?

Thanks, Allan.
Mark Beiley
2007-08-26 17:17:57 UTC
Permalink
Hi Allan,

Here's one solution you can consider:

Write this folder location in the registry, along with a flag that it needs
to be written to your file. When your main program first starts up, if that
flag is set, have it do the writing, and then erase the flag.

Thanks,
Mark
--
Beiley Software
http://www.beiley.com
Post by Allan Phillips
I'm sure that this isn't the right group but I cannot figure out whether
there is a right one.
I have a Win32 application that I've built an install set for using
VS-2005. The install seems to work just fine putting all the files in the
right place alright.
However, I would now like to alter one of the files during the install
process. Once the user has selected a folder to install into I need to
store that folder's name in a text file that came from the install set.
What is the correct way to do that? Is there a way to script that or is
one supposed to create a DLL or EXE to do that bit of work?
Thanks, Allan.
Allan Phillips
2007-08-27 13:58:43 UTC
Permalink
Thanks Mark.

I have a feeling that I'm going to need to do other things as well as the
installation is refined so I would like to know how to include some special
processing as part of the install.

I think your idea would work for this one piece of info. However, I don't
even know how I would figure out which folder the user selected for the
install. There must be some kind of interface to data like that but it sure
seems to be well hidden in the Windows installer.

Thanks,
Allan.
Post by Mark Beiley
Hi Allan,
Write this folder location in the registry, along with a flag that it
needs to be written to your file. When your main program first starts up,
if that flag is set, have it do the writing, and then erase the flag.
Thanks,
Mark
--
Beiley Software
http://www.beiley.com
Post by Allan Phillips
I'm sure that this isn't the right group but I cannot figure out whether
there is a right one.
I have a Win32 application that I've built an install set for using
VS-2005. The install seems to work just fine putting all the files in the
right place alright.
However, I would now like to alter one of the files during the install
process. Once the user has selected a folder to install into I need to
store that folder's name in a text file that came from the install set.
What is the correct way to do that? Is there a way to script that or is
one supposed to create a DLL or EXE to do that bit of work?
Thanks, Allan.
Mark Beiley
2007-08-27 22:24:24 UTC
Permalink
Hi Allan,

I've not used the Windows Installer before, but I would highly recommend
this flexible/free/efficient installer:

http://nsis.sf.net

I know you can get the installation folder (and a lot more) when using this.


Thanks,
Mark
--
Beiley Software
http://www.beiley.com
Post by Allan Phillips
Thanks Mark.
I have a feeling that I'm going to need to do other things as well as the
installation is refined so I would like to know how to include some
special processing as part of the install.
I think your idea would work for this one piece of info. However, I don't
even know how I would figure out which folder the user selected for the
install. There must be some kind of interface to data like that but it
sure seems to be well hidden in the Windows installer.
Thanks,
Allan.
Post by Mark Beiley
Hi Allan,
Write this folder location in the registry, along with a flag that it
needs to be written to your file. When your main program first starts
up, if that flag is set, have it do the writing, and then erase the flag.
Thanks,
Mark
--
Beiley Software
http://www.beiley.com
Post by Allan Phillips
I'm sure that this isn't the right group but I cannot figure out whether
there is a right one.
I have a Win32 application that I've built an install set for using
VS-2005. The install seems to work just fine putting all the files in
the right place alright.
However, I would now like to alter one of the files during the install
process. Once the user has selected a folder to install into I need to
store that folder's name in a text file that came from the install set.
What is the correct way to do that? Is there a way to script that or is
one supposed to create a DLL or EXE to do that bit of work?
Thanks, Allan.
John Rye
2007-10-04 10:26:42 UTC
Permalink
Hi Allan,

I had a similar requirement and wrote a windowless EXE, which took command
line switches and called this from microsoft installer as a 'Custom Action'.
VC 2005 inserts dummy switches for you when you create a Custom Action so
take care to delete them and insert what you want. I had to run the inverse
of the Custom Action at uninstall: VC 2005 gives you a slot to do that - I
used diferent switches for my EXE to indicate what it had to do.

This works just fine installing to XP SP2. There is a complication on Vista:
wouldn't you just know. :-)

On Vista, if your Custom Action needs Administrator privileges, you have to
do the following to get it to work, info courtesy of MS (UK). If the EXE
doesn't need Administrator privileges then ignore what follows.

. When building the EXE, add requestedExecutionLevel
level="requireAdministrator" to an extra manifest file for the custom
action app. You will need to consult some MSDN info to get this to build so
that it's ignored under XP.
. To install on Vista, you or your users have to open a command prompt as
Administrator and, run the installer from there: just typing the .msi file
path and pressing ENTER worked for me.
. At unistall open a command prompt as Administrator, and run msiexec /u
<your>.msi.

I think this is a bug, or over enthusiastic protectionism in Vista. Vista
automatically raises the privilege of installers but not those of its Custom
Actions even if the manifest entry is included. If you don't include the
manifest entry Vista won't try and raise the priveleges so the EXE the the
install fail. Running from a privileged console gets round the restriction.

I hope this helps.

John Rye
Post by Allan Phillips
I'm sure that this isn't the right group but I cannot figure out whether
there is a right one.
I have a Win32 application that I've built an install set for using
VS-2005. The install seems to work just fine putting all the files in the
right place alright.
However, I would now like to alter one of the files during the install
process. Once the user has selected a folder to install into I need to
store that folder's name in a text file that came from the install set.
What is the correct way to do that? Is there a way to script that or is
one supposed to create a DLL or EXE to do that bit of work?
Thanks, Allan.
Loading...