Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Using VS.NET 2003 to build a Setup project for ALLUSERS

342 views
Skip to first unread message

Phil Wilson

unread,
Jul 31, 2004, 12:56:16 PM7/31/04
to
You seem to be focused on VS setup projects, but there is a whole bunch of
tools that will build MSI files:

http://www.installsite.org/pages/en/msi/authoring.htm

In addition, an MSI file is a database with APIs that can make those changes
programmatically if they need to be automated. There's also a scriptable COM
interface - see the *.vbs files in the installer SDK, WiRunSql.vbs in
particular.
--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.amazon.com/exec/obidos/tg/detail/-/1590592972/104-7044380-4696760

"Joe" <J...@discussions.microsoft.com> wrote in message
news:1A9C0910-F2EA-4C10...@microsoft.com...
> I want to create a setup project which will always install my app for All
Users. I've googled for solutions to this and the only way I've seen to do
this is to download the Installer SDK, run the Orca tool and patch the MSI
file (either remove the Installation folder dialog and force ALLUSERS=1, or
patch the "Installation folder" dialog properties so that installation
defaults to all users and the Just Me/Everyone radio buttons are hidden).
>
> However
> a) I want to automate my build and,
> b) I don't want to require all developers who may want to run the build to
download the Installer SDK.
>
> So my question is, is there any way (e.g. using script) of calling
Installer APIs and patching an MSI file without the need to download the
Installer SDK.
>
> Or an alternative, is it possible to create a modified setup project
template in VS.NET 2003 which contains a custom Installation Folder dialog
without the radio buttons.


Joe

unread,
Jul 31, 2004, 3:07:02 PM7/31/04
to
Phil,

Thanks for the response.

Firstly you're quite right that I'm focussed on VS setup projects. the client I'm working for is developing in-house apps, they have VS.NET 2003 and the skills to create & modify deployment projects from within the IDE. I don't want to start them on new tools & a new learning curve.

WiRunSql.vbs sounds like just what I need, provided the objects it makes use of exist on a PC without first installing the Windows Installer SDK (I've already installed the Installer SDK on my dev machine so I can't test this just now, but will do so).

I guess in my automated build I need to run the following after the setup project has been built:

wscript wirunsql.vbs "mysetup.msi" "UPDATE Property SET
Value='ALL' WHERE Property='FolderForm_AllUsers'"

Also I have to run some other queries to hide the Everyone/Just Me radio buttons, if you can tell me the queries to use I'd appreciate it, if not I'll no doubt be able to work it out.

Phil Wilson

unread,
Aug 1, 2004, 1:09:12 PM8/1/04
to
The APIs to update MSI files are in the OS, part of the Windows Installer
engine, so everybody won't need the SDK.

A quick way to fix the radiobutton is to set the Attributes of FolderForm,
AllUsersRadioGroup to 0 in the Control table, that will show the Everyone
choice but it can't be changed (assuming you've set FolderForm_AllUsers to
ALL).

It might be useful to set ALLUSERS to 1 in the property table so that a
silent install defaults to Everyone (the UI isn't shown so ALLUSERS never
gets set).

--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.amazon.com/exec/obidos/tg/detail/-/1590592972/104-7044380-4696760

"Joe" <J...@discussions.microsoft.com> wrote in message

news:01E37BED-ECC1-4979...@microsoft.com...

Joe

unread,
Aug 3, 2004, 7:07:02 AM8/3/04
to
Thanks for this. The following is a batch file which does the necessary.
Joe
======
@echo off
cscript /nologo wirunsql.vbs %1 "UPDATE Property SET Value='ALL' WHERE Property='FolderForm_AllUsers'"
cscript /nologo wirunsql.vbs %1 "UPDATE Control SET Attributes=2 WHERE Dialog_='FolderForm' AND Control='AllUsersRadioGroup'"
cscript /nologo wirunsql.vbs %1 "UPDATE Control SET Attributes=2 WHERE Dialog_='FolderForm' AND Control='AllUsersText'"
cscript /nologo wirunsql.vbs %1 "DELETE FROM ControlCondition WHERE Dialog_='FolderForm' AND Control_='AllUsersRadioGroup'"
cscript /nologo wirunsql.vbs %1 "DELETE FROM ControlCondition WHERE Dialog_='FolderForm' AND Control_='AllUsersText'"
cscript /nologo wirunsql.vbs %1 "DELETE FROM Property WHERE Property='ALLUSERS'"
cscript /nologo wirunsql.vbs %1 "INSERT INTO Property (Property, Value) VALUES('ALLUSERS', '2')
======

Mike Blake-Knox

unread,
Aug 4, 2004, 1:14:17 PM8/4/04
to
In article <1A9C0910-F2EA-4C10...@microsoft.com>, Joe wrote:
> So my question is, is there any way (e.g. using script) of calling Installer
APIs and patching an MSI file without the need to
> download the Installer SDK.

I used MakeMsi to edit the VS created .msi. I've automated it by running MakeMsi
from a .bat file that's run from a Build event in a VS subproject that is built
after the deployment project.

In order to ensure the msi actually installed as For All Users, I found that I
needed to move the FindRelatedProducts action to just before ExecuteAction in
the InstallUISequence table.

Mike

W@discussions.microsoft.com Gary W

unread,
Feb 4, 2005, 7:13:01 PM2/4/05
to
I have exactly this same issue to resolve. Can you tell me how, from where
and when you run this batch file that alters the msi file? I'm having
trouble knowing how to implement what appears to be the perfect solution -
the documentation on scripts, wirunsql, etc is either sketchy or assumes you
already know how to do it.

Mike Blake-Knox

unread,
Feb 6, 2005, 11:02:01 AM2/6/05
to
In article <E7B97657-4345-4C02...@microsoft.com>, Gary W
wrote:

> Can you tell me how, from where
> and when you run this batch file that alters the msi file?
>
I had the same problem and solved it with a batch file that uses
MakeMSI to modify the VS built MSI. I created a dummy/null C++ project
and ran the batch file from its post build event. VS.Net 2003 has build
events for C# projects so you don't need to use a C++ project. I've
make the dummy/null project dependent on the Setup Project so it runs
at the right time.

One advantage of MakeMSI is that it normally validates the output MSI.

Mike

Dennis Bareis

unread,
Feb 7, 2005, 2:09:06 AM2/7/05
to
Hi,

On Sun, 06 Feb 2005 11:02:01 EST, Mike Blake-Knox <mikeb...@spamintrex.net> wrote:

>In article <E7B97657-4345-4C02...@microsoft.com>, Gary W
>wrote:

>One advantage of MakeMSI is that it normally validates the output MSI.

Not to mention error checking and more smarts :-)

Bye,
Dennis
Dennis Bareis [MVP] (den...@KillSpam.dennisbareis.id.au)
http://dennisbareis.id.au/index.htm
Freeware Windows Installer creation tool (+ "ORCA automation"):
http://dennisbareis.id.au/makemsi.htm

0 new messages