WIX Installer CustomAction FileStreams prepend .tmp file ? - Advanced Installer Community

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!

JRimer
Posts: 1
Joined: Thu Jul 01, 2010 8:05 pm

WIX Installer CustomAction FileStreams prepend .tmp file ?

I'm relatively new to Visual Studio/C# in general, but I've recently been tasked with creating a WIX installer for a software package my company needs to deploy with configurable application options (by modifying the App.Config for the installed application) on install.

My task is to create an installer that does the following:
1. copies files to the installation directory without overwriting the App.Config file if it already exists (maintains existing settings from prior installs)
2. after copy, READS the App.Config file and gather's some settings from it and their current (default) values.
3. Prompt the installer user for overrides to any of these settings using dialog boxes prepopulated with the current values from step 2
4. WRITE the values back to the installed App.Config file provided by the user (either the left-alone defaults, or the user's changed input from their input dialogs)
5. Complete the install...

My problem lies in step 2. I am in my custom action static function (called LoadDefaultOptions) and I'm creating an XMLDocument and attempting to load the App.Config file using a session variable that points to the install directory and the file name of the installed App.Config file, as such:

Code: Select all

String AppConfig = session["CONFIGFILE"];
session.Log("Attempting to load the Configuration File to read the defaults at " + AppConfig + ".");
XmlDocument xDoc = new XmlDocument();
xDoc.Load(AppConfig);
When I install this program using /log, the output looks like this:

Attempting to load the Configuration File to read the defaults at C:\Program Files\<correct path to installed app.config> ( from the session.Log() )
LoadDefaultOptions exception: System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\Installer\MSI2548.tmp-\C:\Program Files\<correct path to installed app.config>'. (from the .Load() attempt)

Why is the load function prepending that Windows\Installer\MSIXXXX.tmp- string before my filepath? Can I get rid of this? How do I read files from the file system from a customAction?

BTW, it seems like ANY filestream action I take, whether from an XmlDocument, XmlReader, or FileStream object ALL prepend this value before any URL... Can't find a work around...

Any help is appreciated!
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: WIX Installer CustomAction FileStreams prepend .tmp file ?

Hello,

I am afraid we only provide support for Advanced Installer. You may want to use our product for easier install configurations. You can easily use our import WiX project to seamlessly migrate your project to Advanced Installer.
For WIX related issues, please consult the appropriate WIX support forums.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”