Question

I am currently working on a tool for system administrators that can be used to update all clients of a Windows AD. It needs to work with Group Policy and SMS for the purpose of doing mass-updating. Therefore I need the tool to result in a MSI file.

Is it possible to create a MSI file that does not install anything but instead only does a custom action (ie. run a script or exe-file).

Best Regards Jakob Simon-Gaarde

Was it helpful?

Solution 2

Found a hackish way to solve my problem:

<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
    <Product
        Name='MVLicense Updater' Id='f8fc0a30-c138-1fe2-838b-0845200c9a66'
        UpgradeCode='00ca86a0-c889-12e2-8f8b-0800200c9a66'
        Language='1033' Version='1.0.0.0' Manufacturer='My Company'>

        <Package Id='*' InstallerVersion='200' Compressed='yes' />

        <Media Id='1' Cabinet='my.cab' EmbedCab='yes' />

        <Directory Id='TARGETDIR' Name='SourceDir'>
            <Directory Id='ProgramFilesFolder'>
                <Directory Id='INSTALLDIR' Name='My-Updater'>
                    <Component Id='Readme' Guid='68fef080-c87b-34e2-8889-0824200c9a66'>
                        <File Id='ReadmeTXT' Name='readme.txt' Source='readme.txt' Vital='no' />
                        <RemoveFolder Id="INSTALLDIR" On="uninstall" />
                    </Component>
                </Directory>
            </Directory>
        </Directory>

        <Feature Id='Complete' Level="1">
            <ComponentRef Id='Readme' />
        </Feature>

        <CustomAction Id="ForceError" Error="1602"/>
        <CustomAction Id="RunMyUpdater" BinaryKey="MyUpdaterExe" ExeCommand="dummy" Return="check"/>

        <InstallExecuteSequence>
            <Custom Action='RunMyUpdater' After='InstallInitialize'></Custom>
            <Custom Action="ForceError" After="RunMvlupdate"></Custom>
        </InstallExecuteSequence>

        <AdminExecuteSequence>
            <Custom Action='RunMyUpdater' After='InstallInitialize'></Custom>
            <Custom Action="ForceError" After="RunMyUpdate"></Custom>
        </AdminExecuteSequence>

        <Binary Id="MyUpdaterExe" SourceFile="dist\myupdater.exe" />
        <UI>
            <Error Id="1602">We have a problem</Error>
        </UI>
    </Product>
</Wix>

This does the job of running my executable that does some configuration stuff based on calling an internet service and then rolls back the installation because I force an error to occure.

OTHER TIPS

Yes, it is possible. Shameful, but, possible.

You can make a square peg fit in a round hole but you lose all of the intended benefits.

FWIW, SMS is now called SCCM and it can call EXE commands.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top