0

How to create msi installer which can install file located near by it or fetch this file over http?

We want to create an msi installer with wix toolkit 3.9 that should distribute our virtual machine (size is bigger than allowed in cab files), hypervisor, register(unregister) powershell scripts and something else.

We cannot create MSI with big file. I see two approaches:

  1. We can put virtual machine image located near by msi installed and programming this installer to install image if it exists near by it.

    d:> dir myapp.msi vm.vdi

We can agree with client that he must put vm image located near the msi installer manually, before run it.

  1. Download this vm image with http. What are the options for this?

How I can do this ?

I do this like this:

    <!-- This is a list of directories that are used by this product as installation locations or custom -->
    <!-- action file search locations.                                                                   -->
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="LocalAppDataFolder" Name="AppData">
            <Directory Id="AppRootDirectory" Name="Lookd"/>
        </Directory>
    </Directory>


    <DirectoryRef Id="AppRootDirectory">
        <Component Id="SupplementalScripts" Guid="31693357-578d-4dde-aefc-92f413942810" KeyPath="yes" DiskId="1">
            <CreateFolder/>
            <RemoveFolder Id="RemoveAppRootDirectory" On="uninstall" />

            <File Id="SupplementalScripts_Register" DiskId="1" Vital="yes" Source="dst\Scripts\Register.ps1" Checksum="no"/>
            <File Id="SupplementalScripts_UnRegister" DiskId="1" Vital="yes" Source="dst\Scripts\UnRegister.ps1" Checksum="no"/>
            <File Id="SupplementalScripts_Throw" DiskId="1" Vital="yes" Source="dst\Scripts\Throw.ps1" Checksum="no"/>

            <RegistryKey Root="HKCU" Key="Software\CVisionLab\Lookd" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
                <RegistryValue Name="Version" Value="[ProductVersion]" Type="string"/>
            </RegistryKey>
        </Component>
        <Component Id="VirtualMachineDiskImage" Guid="daa7375f-7bd8-4e97-846a-db5f6e6b025a">
            <CopyFile Id="VDIFile" SourceName="lookd.vdi" SourceDirectory="SOURCEDIR" DestinationDirectory="TARGETDIR" />
        </Component>
    </DirectoryRef>

But I recive and error when build:

error LGHT0094 : Unresolved reference to symbol 'Directory:SOURCEDIR' in section 'Product:{7BBA165B-9A8A-40D1-97FA-233F93426F83}'.

1 Answer 1

0

If 1 will work for you, then a WiX CopyFile should work. The source location of the copy would be the [SourceDir] property, and the destination some directory defined in your WiX.

If it's really that big, download may be tedious, but if you use it then do it from an app you install rather than run it from the MSI install.

Clarifying in response to comment: there are just two recommendations here that are separate and not related:

  1. Use WiX CopyFile if you choose to copy the file from next to the MSI file to the client system.

  2. If you choose the download option, doing that from the MSI will be tedious and very error prone. It may not even work given that VS custom actions have very limited (or no) access to the network. So do a download from the app you're installing and not the MSI, if you do in fact decide to download.

Sign up to request clarification or add additional context in comments.

3 Comments

Why you said about 'download may be tedious' if file is will be placed nearby installer.msi. I did not understand what 'do it from an app you install rather than run it from the MSI install' does mean ? You not recommend pack big file into msi installer ? Or may be something else ?
Can you add an example? Because I recive an error when doing like this.
Search for -wix copyfile example sourcedir- and there are several examples.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.