Deploying CABs to a device via ActiveSync using an MSI with installer class

I'm trying to deploy CAB files from my application to a device using a MSI project using ActiveSync.

This method requires the CAB and ini files to be in a sub directory of ActiveSync. So I'm using an installer class to copy the CAB and ini files from the default c:\programfiles etc to the ActiveSync dir. The default dir is hard coded.

This method is described in the msdn "Deploying >NET Compact Framework 2.0 Applications with cab and msi file"

After a bit of tweaking this method works ok as long as the user does not change the installation folder from the default to something else. If this happens the installer class fails to find the cab and ini files and consequently the deployment fails.

Is there any way of determining what the installation folder specified by the user is



Answer this question

Deploying CABs to a device via ActiveSync using an MSI with installer class

  • 93_confirmed

    Thanks for replying. Had n't come across TARGETDIR before and did n't find the help that helpful for a relatively new user .

    But if someone else has the same question a simple answer is

    using System.Reflection;

    then the path obtained from

    string sPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);


  • knikki98

    ActiveSync/CeAppMgr.exe location is in registry and getting it’s location described in the above article.



  • RB_Banc

    I'm trying to deploy CAB files from my application to a device using a MSI project using ActiveSync.

    This method requires the CAB and ini files to be in a sub directory of ActiveSync. So I'm using an installer class to copy the CAB and ini files from the default c:\programfiles etc to the ActiveSync dir. The default dir is hard coded.

    This method is described in the msdn "Deploying >NET Compact Framework 2.0 Applications with cab and msi file"

    After a bit of tweaking this method works ok as long as the user does not change the installation folder from the default to something else. If this happens the installer class fails to find the cab and ini files and consequently the deployment fails.

    Is there any way of determining what the installation folder specified by the user is

    Thanks


  • sahridhayan

    Installation path is stored in a well known TARGETDIR property in windows installer.

     

    I’d like to point out questions like that are not at all devices specific and should be posted to Windows Installer related forum or NG.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />



  • rvecchio

    Its not the ActiveSync directory I need. The method on how to determine that is shown in the article.
    The ActiveSync directory is the final destination folder for the files.

    Its the temporary folder to which the files are written to initially I want to determine. Its from this folder that the required files are then copied to the ActiveSync folder.
    The article shows the temp folder as Environment.SystemDirectory + @"\temp\projectname";
    which on my machine was c:\windows\system32\temp\projectname.
    However the default directory to which the installation writes the CAB and ini files is actually C:\Program Files\projectname, if I code this as the Temp folder everything works OK as long as the user does not change the default directory, which they do.

    So I need to determine what the actual path is that the user specifies. The user specifies this in the "Select Installatio Folder" dialogue that is shown during installation.

    Within the msi project I came across the "User Interface" feature which has an install and administrative install and the steps that the installation takes. In one of these steps there is the Installation Folder but it has no property or method associated with it that allows me to get the actual path specified.

    So how is it possible to get the installation folder specified in the installation.

    Thanks


  • Deploying CABs to a device via ActiveSync using an MSI with installer class