We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

bmt22033
Posts: 21
Joined: Tue Jun 26, 2012 2:14 pm

Launch attached file (.exe) with dependencies

I've got an installer that needs to launch a .exe file after my installation is complete. This .exe is *not* part of the files that get installed on the system. I'm using a custom action ("Launch Attached File") and this works well but my .exe has a small config file (myExe.config) that needs to go with it. Is there any way to bundle a dependency (in this case, my .config file) with the attached .exe file? Thanks very much!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Launch attached file (.exe) with dependencies

Hi,

If you have dependency files that are used by your .exe custom action, you can add them as temporary files in the "Windows Volume -> Temporary" folder from the "Files and Folders" page, so the "Launch attached file" custom action can find them. I'm afraid that the dependency files cannot be bundled with the custom action.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bmt22033
Posts: 21
Joined: Tue Jun 26, 2012 2:14 pm

Re: Launch attached file (.exe) with dependencies

Hi Eusebiu,

Thanks for the reply. I tried making my .config file a temporary file but when my attached .exe is launched, it doesn't appear to see the .config file. My .exe is a .NET executable which is built against .NET 2.0. The only reason I need the .config file is to tell Windows 8/8.1 that my NET 2.0 .exe can run on .NET 4.5 (as you are no doubt aware .NET 4.5 is installed by default on Windows 8 but .NET 2.0/3.5 is not).

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup>
    <supportedRuntime version="v2.0.50727"/>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
</configuration>
When AI launches my attached .exe on Windows 8/8.1, I get a prompt indicating that I need to download .NET 3.5. When I manually place my .exe and .config file in the same directory and run the .exe, I don't get this prompt. I tried selecting the "Do not remove the file when setup ends" option for my .config file thinking that maybe it was getting deleted before AI launches my .exe but that didn't solve the problem. Also, I'm watching the temp dir (%temp%) and I don't see the attached .exe file getting unpacked here before it runs so I'm guessing that's why my .config file isn't working properly. Does "Launch attached file" unpack the attached file to %temp% before it's run? Or is there a working directory for the attached file that I can copy my .config file to? Thanks very much!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Launch attached file (.exe) with dependencies

Hi,

I'm not sure why your EXE custom action does not find the .config file. The file is indeed extracted in the %temp% directory, but it uses a temporary name (i.e. MSI6F1.tmp), however this should not cause any problem.

If it still does not work, you can add the EXE file also as a temporary file, then use the "Launch file" custom action to run it.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bmt22033
Posts: 21
Joined: Tue Jun 26, 2012 2:14 pm

Re: Launch attached file (.exe) with dependencies

Eusebiu wrote: I'm not sure why your EXE custom action does not find the .config file. The file is indeed extracted in the %temp% directory, but it uses a temporary name (i.e. MSI6F1.tmp), however this should not cause any problem.
Ahhhh, that's the problem then. If AI is unpacking my attached .NET .exe using a temp name, then when the .exe is run, the .NET CLR doesn't find a matching .exe.config file name. To clarify, if my .exe is named myExe.exe, then my configuration file must be myExe.exe.config in order for the .NET CLR to use it.

I've now implemented your alternate suggestion (making the .exe a temporary file and using "Launch file") and all is working well.

Thanks for your help!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Launch attached file (.exe) with dependencies

You're welcome. I'm glad you got this working.

Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”