Results 1 to 3 of 3

Thread: Adding package to Group Policy

  1. #1
    PreviousPoster is offline 100+ Helpful Posts! 50+ Helpful Posts
    Join Date
    Dec 1969
    Posts
    1,254

    Default

    I have created a script to perform the complete 'preparation for deployment' process. It creates the group, GPO, GPO links, removes 'Authenticated Users from the GPO, adds the groups we need to the GPO, creates the AAS script file and copies the MSI etc from dev to Production.

    I had to create a DLL (in VB6, if anyone cares) to provide a script-friendly interface to MSI.DLL, as DynaWrap, the ActiveX interface I *was* using, proved unreliable and returned some bizarre error codes. I created interfaces to all of MSI.DLL's exported functions, although I only needed one, MsiAdvertsieProductA, which is used to create the AAS file. That's because most of the rest are already exposed by the Installer object. As and when I come across ones I need, I'll update my DLL.

    The script runs to completion with no errors, everything looks good. EXCEPT...when I try to examine the package in GPEdit, the 'Software Installation' leaf doesn't appear. I figure if that's not there, there's no chance the package will get deployed.

    I'm thinking the issue is probably with my call to MSIAdvertiseProduct.

    In the documentation for that function (http://msdn2.microsoft.com/en-us/library/aa370056.aspx), the parameter szScriptfilePath is clearly meant to be a string:

    szScriptfilePath

    The full path to script file that will be created with the advertise information. To advertise the product locally to the computer, set ADVERTISEFLAGS_MACHINEASSIGN or ADVERTISEFLAGS_USERASSIGN.

    but then it talks about some flag:

    Flag Meaning

    ADVERTISEFLAGS_MACHINEASSIGN 0 Set to advertise a per-machine installation of the product available to all users.

    ADVERTISEFLAGS_USERASSIGN 1 Set to advertise a per-user installation of the product available to a particular user.

    How can I set this flag? There's nowhere in the function for it! Is there a companion function I need to use first?

  2. #2
    PreviousPoster is offline 100+ Helpful Posts! 50+ Helpful Posts
    Join Date
    Dec 1969
    Posts
    1,254

    Default

    An update, of sorts...

    I've worked out how to use ADVERTISEFLAGS_MACHINEASSIGN and ADVERTISEFLAGS_USERASSIGN.

    One passes EITHER the path to where the .AAS advertising script is to be stored OR one of the 2 flags. The first creates the .AAS and the second advertises the product to the local computer. I blame MS's opaque documentation...

  3. #3
    PreviousPoster is offline 100+ Helpful Posts! 50+ Helpful Posts
    Join Date
    Dec 1969
    Posts
    1,254

    Default

    OK, the script is done and it works, flawlessly so far. I've had to retain the custom DLL as it provides the only method I have of creating the advertising scripts, until such time as WI 4.0 becomes mainstream.

    Given the work I've put into this, with next to no help from people in a position to do so, I will not be giving it away, which was my original intention. I just need to figure a way to protect my code and then I'll unleash it onto an unsuspecting world.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Friendly URLs by vBSEO