0
votes

I'm using msbuild to create a Setup.exe that installs the prerequisites for my application. It works great, but when the prerequisites require a reboot, once Windows is back up I get an error that the MSI could not be found: "Unable to locate application file '[file].msi'.

This is my msbuild config file:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <ItemGroup>
    <BootstrapperFile Include=".NETFramework,Version=v4.0">
        <Visible>False</Visible>
        <ProductName>Microsoft .NET Framework 4.0</ProductName>
        <Install>true</Install>
    </BootstrapperFile>
    <BootstrapperFile Include="Microsoft.Windows.Installer.4.5">
      <Visible>False</Visible>
      <ProductName>Windows Installer 4.5</ProductName>
      <Install>true</Install>
    </BootstrapperFile>
    <BootstrapperFile Include="Windows.Imaging.Component">
      <Visible>False</Visible>
      <ProductName>Windows Imaging Component</ProductName>
      <Install>true</Install>
    </BootstrapperFile>    
  </ItemGroup>

  <Target Name="Bootstrapper">
    <GenerateBootstrapper
      ApplicationFile="myAppInstaller.msi"
      ApplicationName="MyApp"
      BootstrapperItems="@(BootstrapperFile)"
      OutputPath=".\"
      ComponentsLocation="HomeSite"
      Culture="en"/>
  </Target>
</Project>

Any idea why and how to fix it?

Thanks!

1
I've seen such issues if the installer is running from a mapped drive - how are you running your installer?Damien_The_Unbeliever
It wasn't that but the question at the end "how are you running your installer?" directed me to the answer. So thank you, @Damien_The_Unbeliever !Shay Friedman

1 Answers

2
votes

Just found the problem - my installation was executed from WinZip self-extractor which deletes the extracted files once the setup ends. Because one of the prerequisites required a restart, before the computer was restarted, the files had been deleted by the self extractor...

Beware of self extractors folks! :)