Re: [WiX-users] C# Custom Action Fails when InsertingTemoporaryRows.
Thanks Jacob. With some help from your post I seem to have gotten it to at least now not error. It seems to add all the records however now its time to figure out why it is not actually deleting any of the files --Brian -Original Message- From: Hoover, Jacob [mailto:jacob.hoo...@greenheck.com] Sent: Wednesday, October 05, 2011 10:05 AM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] C# Custom Action Fails when Inserting TemoporaryRows. I'm not certain what your exact problem is, but looking at the schema for the remove file table leads me to believe you are missing fields that are not nullable. I've used: const string REMOVEFILES_VIEW = @SELECT `FileKey`, `Component_`, `FileName`, `DirProperty`, `InstallMode` FROM `RemoveFile`; ... var foldersToRemove = Directory.GetDirectories(dataFolder, @*, SearchOption.AllDirectories); var view = session.Database.OpenView(REMOVEFILES_VIEW, null); view.Execute(); foreach (var folderToRemove in foldersToRemove) { var guid = Guid.NewGuid(); string folderProperty = string.Format(@dir_{0}, guid.ToString(@N)); string fileKey = string.Format(@file_{0}, guid.ToString(@N)); string folderKey = string.Format(@folder_{0}, guid.ToString(@N)); session[folderProperty] = folderToRemove + @\; // Remove all the files var record = session.Database.CreateRecord(5); session.Log(@FileKey= + fileKey); record.SetString(1, fileKey); record.SetString(2, Component Name that will always be installed); record.SetString(3, *.*); record.SetString(4, folderProperty); record.SetInteger(5, (int)eInstalMode.msidbRemoveFileInstallModeOnRemove); view.Modify(ViewModifyMode.InsertTemporary, record); // and remove the folder record = session.Database.CreateRecord(5); record.SetString(1, folderKey); record.SetString(2, Component Name that will always be installed); record.SetString(3, null); record.SetString(4, folderProperty); record.SetInteger(5, (int)eInstalMode.msidbRemoveFileInstallModeOnRemove); view.Modify(ViewModifyMode.InsertTemporary, record); } view.Close(); ... with success. Note, I am recursively adding all files and folders from my base folder to be removed. Jacob -Original Message- From: Brian Lemke [mailto:brian.le...@apihealthcare.com] Sent: Wednesday, October 05, 2011 9:48 AM To: General discussion for Windows Installer XMLtoolset. Subject: Re: [WiX-users] C# Custom Action Fails when Inserting TemoporaryRows. The scenario I am trying to handle is the cancel during uninstall. If I were to just bomb the folder the rollback wouldn't work and it would delete the folder anyway. I am going to try and see if I can pressure the team into using 3.6. Don't know if it will be an issue or not. Initially they said no but maybe I can get them to budge. --Brian -Original Message- From: McCain, Jon [mailto:jon.mcc...@inin.com] Sent: Wednesday, October 05, 2011 8:10 AM To: General discussion for Windows Installer XML toolset. Cc: McCain, Jon Subject: Re: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows. I understand maintaining the customers data but isn't the goal here to remove it? Which I agree is against the rules normally but it would appear that is what is wanted... Did I miss something? Jon -Original Message- From: Bob Arnson [mailto:b...@joyofsetup.com] Sent: Tuesday, October 04, 2011 10:23 PM To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows. On 04-Oct-11 15:29, McCain, Jon wrote: If that is the case then you shouldn't need to worry about being a good install writer and just whack the folder or its subfolders that you don't control with your install. Of course you should. If there's a failure or other rollback, the user's data is gone. -- sig://boB http://joyofsetup.com/ -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users -- All the data continuously generated in your
Re: [WiX-users] C# Custom Action Fails when InsertingTemoporaryRows.
A typo. A simple typo mistake. -Original Message- From: Brian Lemke [mailto:brian.le...@apihealthcare.com] Sent: Thursday, October 06, 2011 7:36 AM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] C# Custom Action Fails when InsertingTemoporaryRows. Thanks Jacob. With some help from your post I seem to have gotten it to at least now not error. It seems to add all the records however now its time to figure out why it is not actually deleting any of the files --Brian -Original Message- From: Hoover, Jacob [mailto:jacob.hoo...@greenheck.com] Sent: Wednesday, October 05, 2011 10:05 AM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] C# Custom Action Fails when Inserting TemoporaryRows. I'm not certain what your exact problem is, but looking at the schema for the remove file table leads me to believe you are missing fields that are not nullable. I've used: const string REMOVEFILES_VIEW = @SELECT `FileKey`, `Component_`, `FileName`, `DirProperty`, `InstallMode` FROM `RemoveFile`; ... var foldersToRemove = Directory.GetDirectories(dataFolder, @*, SearchOption.AllDirectories); var view = session.Database.OpenView(REMOVEFILES_VIEW, null); view.Execute(); foreach (var folderToRemove in foldersToRemove) { var guid = Guid.NewGuid(); string folderProperty = string.Format(@dir_{0}, guid.ToString(@N)); string fileKey = string.Format(@file_{0}, guid.ToString(@N)); string folderKey = string.Format(@folder_{0}, guid.ToString(@N)); session[folderProperty] = folderToRemove + @\; // Remove all the files var record = session.Database.CreateRecord(5); session.Log(@FileKey= + fileKey); record.SetString(1, fileKey); record.SetString(2, Component Name that will always be installed); record.SetString(3, *.*); record.SetString(4, folderProperty); record.SetInteger(5, (int)eInstalMode.msidbRemoveFileInstallModeOnRemove); view.Modify(ViewModifyMode.InsertTemporary, record); // and remove the folder record = session.Database.CreateRecord(5); record.SetString(1, folderKey); record.SetString(2, Component Name that will always be installed); record.SetString(3, null); record.SetString(4, folderProperty); record.SetInteger(5, (int)eInstalMode.msidbRemoveFileInstallModeOnRemove); view.Modify(ViewModifyMode.InsertTemporary, record); } view.Close(); ... with success. Note, I am recursively adding all files and folders from my base folder to be removed. Jacob -Original Message- From: Brian Lemke [mailto:brian.le...@apihealthcare.com] Sent: Wednesday, October 05, 2011 9:48 AM To: General discussion for Windows Installer XMLtoolset. Subject: Re: [WiX-users] C# Custom Action Fails when Inserting TemoporaryRows. The scenario I am trying to handle is the cancel during uninstall. If I were to just bomb the folder the rollback wouldn't work and it would delete the folder anyway. I am going to try and see if I can pressure the team into using 3.6. Don't know if it will be an issue or not. Initially they said no but maybe I can get them to budge. --Brian -Original Message- From: McCain, Jon [mailto:jon.mcc...@inin.com] Sent: Wednesday, October 05, 2011 8:10 AM To: General discussion for Windows Installer XML toolset. Cc: McCain, Jon Subject: Re: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows. I understand maintaining the customers data but isn't the goal here to remove it? Which I agree is against the rules normally but it would appear that is what is wanted... Did I miss something? Jon -Original Message- From: Bob Arnson [mailto:b...@joyofsetup.com] Sent: Tuesday, October 04, 2011 10:23 PM To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows. On 04-Oct-11 15:29, McCain, Jon wrote: If that is the case then you shouldn't need to worry about being a good install writer and just whack the folder or its subfolders that you don't control with your install. Of course you should. If there's a failure or other rollback, the user's data is gone. -- sig://boB http://joyofsetup.com/ -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1
Re: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows.
The scenario I am trying to handle is the cancel during uninstall. If I were to just bomb the folder the rollback wouldn't work and it would delete the folder anyway. I am going to try and see if I can pressure the team into using 3.6. Don't know if it will be an issue or not. Initially they said no but maybe I can get them to budge. --Brian -Original Message- From: McCain, Jon [mailto:jon.mcc...@inin.com] Sent: Wednesday, October 05, 2011 8:10 AM To: General discussion for Windows Installer XML toolset. Cc: McCain, Jon Subject: Re: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows. I understand maintaining the customers data but isn't the goal here to remove it? Which I agree is against the rules normally but it would appear that is what is wanted... Did I miss something? Jon -Original Message- From: Bob Arnson [mailto:b...@joyofsetup.com] Sent: Tuesday, October 04, 2011 10:23 PM To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows. On 04-Oct-11 15:29, McCain, Jon wrote: If that is the case then you shouldn't need to worry about being a good install writer and just whack the folder or its subfolders that you don't control with your install. Of course you should. If there's a failure or other rollback, the user's data is gone. -- sig://boB http://joyofsetup.com/ -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users This message (including any attachments) contains confidential and privileged information intended for a specific purpose, and is protected by law. If you are not the intended recipient, you must delete this message and any attachments. You are hereby notified that any disclosure, copying, or distribution of this message, or any attachments, or the taking of any action based on it, is strictly prohibited. Opinions, conclusions, and other information in this message that do not relate to the official business of API Healthcare Corporation (API Healthcare) shall be understood as neither given nor endorsed by API Healthcare. API Healthcare Corporation 1550 Innovation Way Hartford, WI 53027 -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users
[WiX-users] C# Custom Action Fails when Inserting Temoporary Rows.
I'm hoping that someone can help me out. I cannot seem to figure out why my custom action is constantly failing me. The action executes on uninstall and is to browse the install folder and add files to the RemoveFile table (with a few additional properties too) in the MSI so that the file is removed during uninstall. The action is defined as InstallExecuteSequence Custom Action=PurgeFolder After=InstallInitialize ![CDATA[REMOVE~=ALL AND NOT UPGRADINGPRODUCTCODE]] /Custom /InstallExecuteSequence The action runs as expected as I can get log messages to show up in the log file. However whenever the action attempts to insert a temporary row (Either in the Property Table or the RemoveFile table) I get the exception: Microsoft.Deployment.WindowsInstaller.InstallerException: Function failed during execution. Database: Table(s) Update failed. at Microsoft.Deployment.WindowsInstaller.View.Modify(ViewModifyMode mode, Record record) The method for updating the view looks like Record newRecord = session.Database.CreateRecord(2); newRecord.SetString(1, directoryProperty); newRecord.SetString(2, directory.FullName); session.Log(String.Format(Adding Property {0}, newRecord.ToString())); propertyView.Modify(ViewModifyMode.InsertTemporary, newRecord); I have even tried executing a straight insert statement like INSERT INTO Property ('Property', 'Value') Values (Value1, Value2) TEMPORARY to no avail. And there is no way the directory property name could be conflicting as it is part static with a GUID (stripped of the hyphens) appended to the end of it. I am almost at my wits end here. I am half a step away from the CA just blowing away the whole directory but I am trying to be a good Windows Installer citizen here and use the tools as they are. --Brian -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users
Re: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows.
Because most of these are nested in folders created by the application. I would really like to use the RemoveFolderEX element found in Wix 3.6 but I am not allowed to use that version yet. I am forced to stay on 3.5 -Original Message- From: McCain, Jon [mailto:jon.mcc...@inin.com] Sent: Tuesday, October 04, 2011 2:03 PM To: General discussion for Windows Installer XML toolset. Cc: McCain, Jon Subject: Re: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows. Just curious here but why not use the RemoveFile element within the component that initially installed the file or do you not own this file? Also, AFAIK If you remove all files in the fashion above that directory will be removed as well. Jon W. McCain | Software Engineer - Install phone fax +1.317.715.8462 | jon.mcc...@inin.com Interactive Intelligence Inc. Deliberately Innovative www.inin.com -Original Message- From: Brian Lemke [mailto:brian.le...@apihealthcare.com] Sent: Tuesday, October 04, 2011 2:45 PM To: wix-users@lists.sourceforge.net Subject: [WiX-users] C# Custom Action Fails when Inserting Temoporary Rows. I'm hoping that someone can help me out. I cannot seem to figure out why my custom action is constantly failing me. The action executes on uninstall and is to browse the install folder and add files to the RemoveFile table (with a few additional properties too) in the MSI so that the file is removed during uninstall. The action is defined as InstallExecuteSequence Custom Action=PurgeFolder After=InstallInitialize ![CDATA[REMOVE~=ALL AND NOT UPGRADINGPRODUCTCODE]] /Custom /InstallExecuteSequence The action runs as expected as I can get log messages to show up in the log file. However whenever the action attempts to insert a temporary row (Either in the Property Table or the RemoveFile table) I get the exception: Microsoft.Deployment.WindowsInstaller.InstallerException: Function failed during execution. Database: Table(s) Update failed. at Microsoft.Deployment.WindowsInstaller.View.Modify(ViewModifyMode mode, Record record) The method for updating the view looks like Record newRecord = session.Database.CreateRecord(2); newRecord.SetString(1, directoryProperty); newRecord.SetString(2, directory.FullName); session.Log(String.Format(Adding Property {0}, newRecord.ToString())); propertyView.Modify(ViewModifyMode.InsertTemporary, newRecord); I have even tried executing a straight insert statement like INSERT INTO Property ('Property', 'Value') Values (Value1, Value2) TEMPORARY to no avail. And there is no way the directory property name could be conflicting as it is part static with a GUID (stripped of the hyphens) appended to the end of it. I am almost at my wits end here. I am half a step away from the CA just blowing away the whole directory but I am trying to be a good Windows Installer citizen here and use the tools as they are. --Brian -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users
[WiX-users] Question about Patching And Installs
I have a setup that installs as v1.0.0. Then I have a created a patch that updates to v1.0.1 and second patch that will update either a v1.0.0 or v1.0.1 to v1.0.2. This works as expected. These are all minor upgrades (Product and Upgrade Code stay the same with only changes to the product version). In the creation of these patches I used the style defined in the WiX documentation as Using Purely WiX. So in this process I have a MSI for v1.0.0, v1.0.1 and v1.0.2. When I use the v1.0.1 MSI to do my initial install, I can no longer use the v1.0.2 patch. When I attempt to install I get Installation success or error status: 1642. error. I presume this is expected behavior? Or should I be setting something else with my Patch file? Here is my Patch and PatchFamily elements. Patch AllowRemoval=yes Manufacturer=$(var.CompanyLegalName) DisplayName=$(var.InstallName) SU2 Description=$(var.InstallFullName) SU2 Classification=Update MinorUpdateTargetRTM=yes PatchFamily Id=Updates Version=3.0.0.0 Supersede=yes ProductCode=$(var.ProductCode) --Brian -- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos much more. Register early save! http://p.sf.net/sfu/rim-blackberry-1 ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users
[WiX-users] Preventing a patch from installing.
Is it possible to prevent an update from applying to the system? I have a scenario where I have shipped v1.0 of my setup which has patches 1 and 2. After patch 2 is out but before the client can install it, they detect a critical error in patch 1 that requires us to immediately patch it (creating patch 3). Is there anything I can do that once patch 3 is installed to prevent patch 2 from installing since it may re-break the fix, especially if patch 2 edited the same files as patch 3. Or am I not understanding how patching is intended to work? (I come from a home grown setup system and trying to convert to use MSI\WiX.) --Brian This message (including any attachments) contains confidential and privileged information intended for a specific purpose, and is protected by law. If you are not the intended recipient, you must delete this message and any attachments. You are hereby notified that any disclosure, copying, or distribution of this message, or any attachments, or the taking of any action based on it, is strictly prohibited. Opinions, conclusions, and other information in this message that do not relate to the official business of API Healthcare Corporation (API Healthcare) shall be understood as neither given nor endorsed by API Healthcare. API Healthcare Corporation 1550 Innovation Way Hartford, WI 53027 -- Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/ ___ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users