EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Problem with InstallIcon during Install using a CustomAction

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#27119
Posted: 11/05/2013 04:25:13
by Keith Ball (Basic support level)
Joined: 09/03/2013
Posts: 4

Hi,

I am calling an elevated deferred CustomAction from a WiX MSI to install the Driver. At the same time I am trying to install an icon. This however is failing ...


Code
string installationPath = session.CustomActionData["GetInstallPath"];

         // Install driver
         string driverFilePath = UnpackDriver();

         session.Log("Unpacking driver to " + driverFilePath + " Does driver exist? " + File.Exists(driverFilePath));

         uint reboot = 0;
         CallbackFileSystem.Install(
                              driverFilePath,
                              AppGuid,
                              System.Environment.SystemDirectory,
                              false,
                              CallbackFileSystem.CBFS_MODULE_NET_REDIRECTOR_DLL | CallbackFileSystem.CBFS_MODULE_MOUNT_NOTIFIER_DLL,
                              ref reboot);

         session.Log("Reboot after driver installed? " + reboot);

         // Install the icon to be used for the drive
         string iconPath = Path.Combine(installationPath, "bsync.ico");

         session.Log("Locating icon to " + iconPath + " Does icon exist? " + File.Exists(iconPath));

         bool iconReboot = false;
         if (File.Exists(iconPath))
         {
            try
            {
               session.Log("Going to init application....");

               // Call initialize before installing the icon
               CallbackFileSystem.Initialize(AppGuid);

               session.Log("Application is initialized");

               // Install the icon
               CallbackFileSystem.InstallIcon(iconPath, "MyDriveIcon", ref iconReboot);

               session.Log("Reboot after icon install? " + iconReboot);
            }
            catch (Exception exception)
            {
               session.Log("Unable to install icon " + exception);
            }
         }


The code runs fine up until InstallIcon at which point it throws an exception saying "The file could not be found". That is despite the iconPath being confirmed as existing.

Any help would be great!
#27137
Posted: 11/05/2013 08:02:19
by Vladimir Cherniga (EldoS Corp.)

Could you check the system events log on application page and find any cbfs5(4) error records ?
#27138
Posted: 11/05/2013 08:29:37
by Keith Ball (Basic support level)
Joined: 09/03/2013
Posts: 4

There is an error there:

Code
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
  <Provider Name="cbfs4" />
  <EventID Qualifiers="0">1</EventID>
  <Level>2</Level>
  <Task>0</Task>
  <Keywords>0x80000000000000</Keywords>
  <TimeCreated SystemTime="2013-11-05T14:21:46.000000000Z" />
  <EventRecordID>319</EventRecordID>
  <Channel>Application</Channel>
  <Computer>Win7Test</Computer>
  <Security />
  </System>
  <EventData>
  <Data>2</Data>
  <Binary>690D...6300</Binary>
  </EventData>
  </Event>
#27141
Posted: 11/05/2013 08:46:12
by Vladimir Cherniga (EldoS Corp.)

Thanks, specify please the version of CallbackFS build.
#27143
Posted: 11/05/2013 08:52:56
by Vladimir Cherniga (EldoS Corp.)

And operation system (x32/x64).
#27144
Posted: 11/05/2013 08:55:56
by Keith Ball (Basic support level)
Joined: 09/03/2013
Posts: 4

Driver reports 4.0.136.25

The CBFS4Net.dll reports verison 4.0.136.0.

Operating system is Windows 7 Enterprise (sp1) 32 bit
#27146
Posted: 11/05/2013 09:10:28
by Vladimir Cherniga (EldoS Corp.)

It's likely possible that the problem is already fixed in the most recent build of CallbackFS. Please update to v.4.0.138 and recheck the issue. Thank you.
#27167
Posted: 11/06/2013 04:54:07
by Keith Ball (Basic support level)
Joined: 09/03/2013
Posts: 4

Thank you for your help. I updated to the latest version, the icon is installed correctly and is set correctly for the drive.
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 1666 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!