May 02, 2013
03:15 PM
What is catest? Fantastic idea on the pausing, never thought of that before, thanks!
... View more
May 02, 2013
09:29 AM
The file is present during execution. So there is nothing going on there.
... View more
May 01, 2013
03:30 PM
Hello All, I have what should be a basic question... We have a complex logic structure to remove unused files based on how an xml file is generated. But basically we want to remove unused files. So since this logic is quite complex, i put it into a c# console application. I call in the deferred in system context custom action, exe type, installed with product. (I'm using a basic MSI project). When i call the exe, no files are deleted. However, when the installation is completed, and i double click the exe console app, the files are being deleted, no problem. Is this because the installer has a hold on the files until the installation is 100% complete? I can't quite figure out what is going on. I've tried calling it in the Deferred sequence, Deferred in System Context. Please advise. TIA
... View more
Labels
- Labels:
-
InstallShield 2012 Spring
Apr 11, 2013
02:46 PM
Here is the code i used, i created a C# console application. Disclaimer - I'm no c# guru, so i'm sure there are better more efficient ways of doing this. But if you have a little familiarity with xpath and c#, you can whip up something relatively easy with my script. So basically, depending on my properties set in the registry, it instructs the console app, which is called via custom action to perform an action based on what i've set in the UI of my app. Enjoy! [CODE]using System; using System.Collections.Generic; using System.Text; using System.Linq; using System.Net; using System.Xml.Linq; using System.Xml.XPath; using System.Xml; using System.Data; using Microsoft.Win32; using System.Collections; namespace DeviceLinkHelper { class Program { public const string regKeyPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\PlexusIS\\DeviceLink\\"; public static string machineSettingsDir; public static string machineInstallDir; static void Main(string[] args) { //set variables... machineSettingsDir = RegGetter(regKeyPath, "InstallDir"); machineSettingsDir = machineSettingsDir + "Settings\\"; machineInstallDir = RegGetter(regKeyPath, "InstallDir"); //Refactor this **** when time allows... //MachineOne Variable Set. string regKeyPathOne = regKeyPath + "MachineOne"; string machineOneType = RegGetter(regKeyPathOne, "MachineOneType"); string machineOneDeviceName = RegGetter(regKeyPathOne, "MachineOneDeviceName"); string machineOneConnectionType = RegGetter(regKeyPathOne, "MachineOneConnectionType"); string machineOneIpAddress = RegGetter(regKeyPathOne, "MachineOneIpAddress"); string machineOneIpPort = RegGetter(regKeyPathOne, "MachineOneIpPort"); string machineOneComPort = RegGetter(regKeyPathOne, "MachineOneComPort"); string machineOneDataBits = RegGetter(regKeyPathOne, "MachineOneDataBits"); string machineOneStopBits = RegGetter(regKeyPathOne, "MachineOneStopBits"); string machineOneBaudRate = RegGetter(regKeyPathOne, "MachineOneBaudRate"); string machineOneParity = RegGetter(regKeyPathOne, "MachineOneParity"); string machineOneDebug = RegGetter(regKeyPathOne, "MachineOneDebug"); string machineOneEnabled = RegGetter(regKeyPathOne, "MachineOneEnabled"); string machineOnePollInterval = RegGetter(regKeyPathOne, "MachineOnePollInterval"); if (machineOneType == null) { //do nothing. } else { switch (machineOneType) { case "DATASCOPE": { xmlFileWriter(machineSettingsDir + "Datascope.DatascopeDevice.xml", machineOneDeviceName, machineOneConnectionType, machineOneIpAddress, machineOneIpPort, machineOneComPort, machineOneDataBits, machineOneStopBits, machineOneBaudRate, machineOneParity, machineOneDebug, machineOneEnabled, machineOnePollInterval); xmlDestinationFileWriter(machineSettingsDir + "Datascope.DatascopeDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DATEXOHMEDA": { xmlFileWriter(machineSettingsDir + "DatexOhmeda.DatexOhmedaDevice.xml", machineOneDeviceName, machineOneConnectionType, machineOneIpAddress, machineOneIpPort, machineOneComPort, machineOneDataBits, machineOneStopBits, machineOneBaudRate, machineOneParity, machineOneDebug, machineOneEnabled, machineOnePollInterval); xmlDestinationFileWriter(machineSettingsDir + "DatexOhmeda.DatexOhmedaDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DATEXOHMEDARGM5250": { xmlFileWriter(machineSettingsDir + "DatexOhmeda.OhmedaRGM5250.xml", machineOneDeviceName, machineOneConnectionType, machineOneIpAddress, machineOneIpPort, machineOneComPort, machineOneDataBits, machineOneStopBits, machineOneBaudRate, machineOneParity, machineOneDebug, machineOneEnabled, machineOnePollInterval); xmlDestinationFileWriter(machineSettingsDir + "DatexOhmeda.OhmedaRGM5250.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DRAGERVITALINK": { xmlFileWriter(machineSettingsDir + "Drager.DragerVitalinkDevice.xml", machineOneDeviceName, machineOneConnectionType, machineOneIpAddress, machineOneIpPort, machineOneComPort, machineOneDataBits, machineOneStopBits, machineOneBaudRate, machineOneParity, machineOneDebug, machineOneEnabled, machineOnePollInterval); xmlDestinationFileWriter(machineSettingsDir + "Drager.DragerVitalinkDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DRAGERMEDIABUS": { xmlFileWriter(machineSettingsDir + "Drager.DragerMedibusDevice.xml", machineOneDeviceName, machineOneConnectionType, machineOneIpAddress, machineOneIpPort, machineOneComPort, machineOneDataBits, machineOneStopBits, machineOneBaudRate, machineOneParity, machineOneDebug, machineOneEnabled, machineOnePollInterval); xmlDestinationFileWriter(machineSettingsDir + "Drager.DragerMedibusDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } } } //MachineTwo Variable Set. string regKeyPathTwo = regKeyPath + "MachineTwo"; string machineTwoType = RegGetter(regKeyPathTwo, "MachineTwoType"); string machineTwoDeviceName = RegGetter(regKeyPathTwo, "MachineTwoDeviceName"); string machineTwoConnectionType = RegGetter(regKeyPathTwo, "MachineTwoConnectionType"); string machineTwoIpAddress = RegGetter(regKeyPathTwo, "MachineTwoIpAddress"); string machineTwoIpPort = RegGetter(regKeyPathTwo, "MachineTwoIpPort"); string machineTwoComPort = RegGetter(regKeyPathTwo, "MachineTwoComPort"); string machineTwoDataBits = RegGetter(regKeyPathTwo, "MachineTwoDataBits"); string machineTwoStopBits = RegGetter(regKeyPathTwo, "MachineTwoStopBits"); string machineTwoBaudRate = RegGetter(regKeyPathTwo, "MachineTwoBaudRate"); string machineTwoParity = RegGetter(regKeyPathTwo, "MachineTwoParity"); string machineTwoDebug = RegGetter(regKeyPathTwo, "MachineTwoDebug"); string machineTwoEnabled = RegGetter(regKeyPathTwo, "MachineTwoEnabled"); string machineTwoPollInterval = RegGetter(regKeyPathTwo, "MachineTwoPollInterval"); if (machineTwoType == null) { //Do nothing. } else { switch (machineTwoType) { case "DATASCOPE": { xmlFileWriter(machineSettingsDir + "Datascope.DatascopeDevice.xml", machineTwoDeviceName, machineTwoConnectionType, machineTwoIpAddress, machineTwoIpPort, machineTwoComPort, machineTwoDataBits, machineTwoStopBits, machineTwoBaudRate, machineTwoParity, machineTwoDebug, machineTwoEnabled, machineTwoPollInterval); xmlDestinationFileWriter(machineSettingsDir + "WelchAllynPropaq.WelchAllynPropaqDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DATEXOHMEDA": { xmlFileWriter(machineSettingsDir + "DatexOhmeda.DatexOhmedaDevice.xml", machineTwoDeviceName, machineTwoConnectionType, machineTwoIpAddress, machineTwoIpPort, machineTwoComPort, machineTwoDataBits, machineTwoStopBits, machineTwoBaudRate, machineTwoParity, machineTwoDebug, machineTwoEnabled, machineTwoPollInterval); xmlDestinationFileWriter(machineSettingsDir + "DatexOhmeda.DatexOhmedaDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DATEXOHMEDARGM5250": { xmlFileWriter(machineSettingsDir + "DatexOhmeda.OhmedaRGM5250.xml", machineTwoDeviceName, machineTwoConnectionType, machineTwoIpAddress, machineTwoIpPort, machineTwoComPort, machineTwoDataBits, machineTwoStopBits, machineTwoBaudRate, machineTwoParity, machineTwoDebug, machineTwoEnabled, machineTwoPollInterval); xmlDestinationFileWriter(machineSettingsDir + "DatexOhmeda.OhmedaRGM5250.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DRAGERVITALINK": { xmlFileWriter(machineSettingsDir + "Drager.DragerVitalinkDevice.xml", machineTwoDeviceName, machineTwoConnectionType, machineTwoIpAddress, machineTwoIpPort, machineTwoComPort, machineTwoDataBits, machineTwoStopBits, machineTwoBaudRate, machineTwoParity, machineTwoDebug, machineTwoEnabled, machineTwoPollInterval); xmlDestinationFileWriter(machineSettingsDir + "Drager.DragerVitalinkDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DRAGERMEDIABUS": { xmlFileWriter(machineSettingsDir + "Drager.DragerMedibusDevice.xml", machineTwoDeviceName, machineTwoConnectionType, machineTwoIpAddress, machineTwoIpPort, machineTwoComPort, machineTwoDataBits, machineTwoStopBits, machineTwoBaudRate, machineTwoParity, machineTwoDebug, machineTwoEnabled, machineTwoPollInterval); xmlDestinationFileWriter(machineSettingsDir + "Drager.DragerMedibusDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } } } //MachineThree Variable Set. string regKeyPathThree = regKeyPath + "MachineThree"; string machineThreeType = RegGetter(regKeyPathThree, "MachineThreeType"); string machineThreeDeviceName = RegGetter(regKeyPathThree, "MachineThreeDeviceName"); string machineThreeConnectionType = RegGetter(regKeyPathThree, "MachineThreeConnectionType"); string machineThreeIpAddress = RegGetter(regKeyPathThree, "MachineThreeIpAddress"); string machineThreeIpPort = RegGetter(regKeyPathThree, "MachineThreeIpPort"); string machineThreeComPort = RegGetter(regKeyPathThree, "MachineThreeComPort"); string machineThreeDataBits = RegGetter(regKeyPathThree, "MachineThreeDataBits"); string machineThreeStopBits = RegGetter(regKeyPathThree, "MachineThreeStopBits"); string machineThreeBaudRate = RegGetter(regKeyPathThree, "MachineThreeBaudRate"); string machineThreeParity = RegGetter(regKeyPathThree, "MachineThreeParity"); string machineThreeDebug = RegGetter(regKeyPathThree, "MachineThreeDebug"); string machineThreeEnabled = RegGetter(regKeyPathThree, "MachineThreeEnabled"); string machineThreePollInterval = RegGetter(regKeyPathThree, "MachineThreePollInterval"); if (machineThreeType == null) { //do nothing. } else { switch (machineThreeType) { case "DATASCOPE": { xmlFileWriter(machineSettingsDir + "Datascope.DatascopeDevice.xml", machineThreeDeviceName, machineThreeConnectionType, machineThreeIpAddress, machineThreeIpPort, machineThreeComPort, machineThreeDataBits, machineThreeStopBits, machineThreeBaudRate, machineThreeParity, machineThreeDebug, machineThreeEnabled, machineThreePollInterval); xmlDestinationFileWriter(machineSettingsDir + "Datascope.DatascopeDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DATEXOHMEDA": { xmlFileWriter(machineSettingsDir + "DatexOhmeda.DatexOhmedaDevice.xml", machineThreeDeviceName, machineThreeConnectionType, machineThreeIpAddress, machineThreeIpPort, machineThreeComPort, machineThreeDataBits, machineThreeStopBits, machineThreeBaudRate, machineThreeParity, machineThreeDebug, machineThreeEnabled, machineThreePollInterval); xmlDestinationFileWriter(machineSettingsDir + "DatexOhmeda.DatexOhmedaDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DATEXOHMEDARGM5250": { xmlFileWriter(machineSettingsDir + "DatexOhmeda.OhmedaRGM5250.xml", machineThreeDeviceName, machineThreeConnectionType, machineThreeIpAddress, machineThreeIpPort, machineThreeComPort, machineThreeDataBits, machineThreeStopBits, machineThreeBaudRate, machineThreeParity, machineThreeDebug, machineThreeEnabled, machineThreePollInterval); xmlDestinationFileWriter(machineSettingsDir + "DatexOhmeda.OhmedaRGM5250.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DRAGERVITALINK": { xmlFileWriter(machineSettingsDir + "Drager.DragerVitalinkDevice.xml", machineThreeDeviceName, machineThreeConnectionType, machineThreeIpAddress, machineThreeIpPort, machineThreeComPort, machineThreeDataBits, machineThreeStopBits, machineThreeBaudRate, machineThreeParity, machineThreeDebug, machineThreeEnabled, machineThreePollInterval); xmlDestinationFileWriter(machineSettingsDir + "Drager.DragerVitalinkDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DRAGERMEDIABUS": { xmlFileWriter(machineSettingsDir + "Drager.DragerMedibusDevice.xml", machineThreeDeviceName, machineThreeConnectionType, machineThreeIpAddress, machineThreeIpPort, machineThreeComPort, machineThreeDataBits, machineThreeStopBits, machineThreeBaudRate, machineThreeParity, machineThreeDebug, machineThreeEnabled, machineThreePollInterval); xmlDestinationFileWriter(machineSettingsDir + "Drager.DragerMedibusDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } } } //MachineFour Variable Set. string regKeyPathFour = regKeyPath + "MachineFour"; string machineFourType = RegGetter(regKeyPathFour, "MachineFourType"); string machineFourDeviceName = RegGetter(regKeyPathFour, "MachineFourDeviceName"); string machineFourConnectionType = RegGetter(regKeyPathFour, "MachineFourConnectionType"); string machineFourIpAddress = RegGetter(regKeyPathFour, "MachineFourIpAddress"); string machineFourIpPort = RegGetter(regKeyPathFour, "MachineFourIpPort"); string machineFourComPort = RegGetter(regKeyPathFour, "MachineFourComPort"); string machineFourDataBits = RegGetter(regKeyPathFour, "MachineFourDataBits"); string machineFourStopBits = RegGetter(regKeyPathFour, "MachineFourStopBits"); string machineFourBaudRate = RegGetter(regKeyPathFour, "MachineFourBaudRate"); string machineFourParity = RegGetter(regKeyPathFour, "MachineFourParity"); string machineFourDebug = RegGetter(regKeyPathFour, "MachineFourDebug"); string machineFourEnabled = RegGetter(regKeyPathFour, "MachineFourEnabled"); string machineFourPollInterval = RegGetter(regKeyPathFour, "MachineFourPollInterval"); if (machineFourType == null) { //do nothing. } else { switch (machineFourType) { case "DATASCOPE": { xmlFileWriter(machineSettingsDir + "Datascope.DatascopeDevice.xml", machineFourDeviceName, machineFourConnectionType, machineFourIpAddress, machineFourIpPort, machineFourComPort, machineFourDataBits, machineFourStopBits, machineFourBaudRate, machineFourParity, machineFourDebug, machineFourEnabled, machineFourPollInterval); xmlDestinationFileWriter(machineSettingsDir + "Datascope.DatascopeDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DATEXOHMEDA": { xmlFileWriter(machineSettingsDir + "DatexOhmeda.DatexOhmedaDevice.xml", machineFourDeviceName, machineFourConnectionType, machineFourIpAddress, machineFourIpPort, machineFourComPort, machineFourDataBits, machineFourStopBits, machineFourBaudRate, machineFourParity, machineFourDebug, machineFourEnabled, machineFourPollInterval); xmlDestinationFileWriter(machineSettingsDir + "DatexOhmeda.DatexOhmedaDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DATEXOHMEDARGM5250": { xmlFileWriter(machineSettingsDir + "DatexOhmeda.OhmedaRGM5250.xml", machineFourDeviceName, machineFourConnectionType, machineFourIpAddress, machineFourIpPort, machineFourComPort, machineFourDataBits, machineFourStopBits, machineFourBaudRate, machineFourParity, machineFourDebug, machineFourEnabled, machineFourPollInterval); xmlDestinationFileWriter(machineSettingsDir + "DatexOhmeda.OhmedaRGM5250.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DRAGERVITALINK": { xmlFileWriter(machineSettingsDir + "Drager.DragerVitalinkDevice.xml", machineFourDeviceName, machineFourConnectionType, machineFourIpAddress, machineFourIpPort, machineFourComPort, machineFourDataBits, machineFourStopBits, machineFourBaudRate, machineFourParity, machineFourDebug, machineFourEnabled, machineFourPollInterval); xmlDestinationFileWriter(machineSettingsDir + "Drager.DragerVitalinkDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } case "DRAGERMEDIABUS": { xmlFileWriter(machineSettingsDir + "Drager.DragerMedibusDevice.xml", machineFourDeviceName, machineFourConnectionType, machineFourIpAddress, machineFourIpPort, machineFourComPort, machineFourDataBits, machineFourStopBits, machineFourBaudRate, machineFourParity, machineFourDebug, machineFourEnabled, machineFourPollInterval); xmlDestinationFileWriter(machineSettingsDir + "Drager.DragerMedibusDevice.xml", machineInstallDir + "DeviceLink.xml"); break; } } } } //Function to get registry values set by Installshield to use in this helper app to set the xml. static string RegGetter(string keyPath, string keyName) { string returnKey = (string)Registry.GetValue(keyPath, keyName, null); if (returnKey == null) { Console.WriteLine("Registry key " + keyName + " is empty!"); } return returnKey; } //Function to registry values to XML files... static void xmlFileWriter(string xmlFile, string xmlMachineDeviceName, string xmlMachineConnectionType, string xmlMachineIpAddress, string xmlMachineIpPort, string xmlMachineComPort, string xmlMachineDataBits, string xmlMachineStopBits, string xmlMachineBaudRate, string xmlMachineParity, string xmlMachineDebug, string xmlMachineEnabled, string xmlMachinePollInterval) { //start parsing file here. var xdocument = System.Xml.Linq.XDocument.Load(xmlFile); var elements = xdocument.XPathSelectElements("//Device"); try { foreach (var element in elements) { element.Attribute("Name").SetValue(xmlMachineDeviceName); element.Attribute("ConnectionType").SetValue(xmlMachineConnectionType); element.Attribute("IPAddress").SetValue(xmlMachineIpAddress); element.Attribute("IPPort").SetValue(xmlMachineIpPort); element.Attribute("ComPort").SetValue(xmlMachineComPort); element.Attribute("BaudRate").SetValue(xmlMachineBaudRate); element.Attribute("Parity").SetValue(xmlMachineParity); element.Attribute("DataBits").SetValue(xmlMachineDataBits); element.Attribute("StopBits").SetValue(xmlMachineStopBits); element.SetElementValue("Debug", xmlMachineDebug); element.SetElementValue("Enabled", xmlMachineEnabled); element.SetElementValue("PollInterval", xmlMachinePollInterval); } } catch (Exception ex) { Console.WriteLine(ex.Message); } xdocument.Save(xmlFile); } //Function to write machine specific static void xmlDestinationFileWriter(string sourceFile, string destFile) { //First, grab the variables from the registry needed to perform the replacements in the xml. string machineInstallDir = RegGetter(regKeyPath, "InstallDir"); string machineDomainID = RegGetter(regKeyPath, "DomainID"); string machinePlexusCloud = RegGetter(regKeyPath, "PlexusCloud"); string machineTcpCommondPort = RegGetter(regKeyPath, "TcpCommondPort"); string machineTcpIpAddy = RegGetter(regKeyPath, "TcpIpAddy"); string machineTcpPortNo = RegGetter(regKeyPath, "TcpPortNo"); string machineUdpPortNo = RegGetter(regKeyPath, "UdpPortNo"); string machineUseHttps = RegGetter(regKeyPath, "UseHttps"); string machineUseTcp = RegGetter(regKeyPath, "UseTcp"); string machineUseUdp = RegGetter(regKeyPath, "UseUdp"); string machineUseUdpIpAddy = RegGetter(regKeyPath, "UseUdpIpAddy"); //Second, set the xml elements in the existing skeleton file. var xdocument = System.Xml.Linq.XDocument.Load(destFile); var elements = xdocument.XPathSelectElements("//DeviceLink"); try { foreach (var element in elements) { element.Attribute("DomainID").SetValue(machineDomainID); element.Attribute("UseHttps").SetValue(machineUseHttps); element.Attribute("PlexusCloudURL").SetValue(machinePlexusCloud); element.Attribute("UseTCP").SetValue(machineUseTcp); element.Attribute("IPAddress").SetValue(machineTcpIpAddy); element.Attribute("Port").SetValue(machineTcpPortNo); element.Attribute("UseUDP").SetValue(machineUseUdp); element.Attribute("UDPRemoteIPAddress").SetValue(machineUseUdpIpAddy); element.Attribute("UDPRemotePort").SetValue(machineUdpPortNo); element.Attribute("CommandPort").SetValue(machineTcpCommondPort); } } catch (Exception ex) { Console.WriteLine(ex.Message); } xdocument.Save(destFile); //Third, append the device xml file into the node. XmlDocument sourceDoc = new XmlDocument(); XmlDocument destDoc = new XmlDocument(); sourceDoc.Load(sourceFile); destDoc.Load(destFile); try { //Load both files. sourceDoc.Load(sourceFile); destDoc.Load(destFile); //sourceDoc.PreserveWhitespace = true; don't do this, ends up messing up the formatting. Go figure. //destDoc.PreserveWhitespace = true; //Grab elements from source file, write them to dest file. var node = destDoc.SelectSingleNode("//Devices"); node.AppendChild(destDoc.ImportNode(sourceDoc.SelectSingleNode("//Device"), true)); destDoc.Save(destFile); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } } [/CODE]
... View more
Mar 29, 2013
12:23 PM
Chris not a bad idea at all. I went the C# console app route instead. Too complicated otherwise. Thanks though!
... View more
Mar 28, 2013
03:15 PM
While i know you are right and there is nothing more in this world i want to do than to push back on this, with this particular project, it's just not possible. I have to get this working. For the life of me, even my most basic example above, i can't get it to do anything to the XML. I don't know if it's because i'm pointing to DOM 4.0 or because of other reasons. This is extremely frustrating.... If i do get this working, i'm going to create a whole tutorial around this for someone else possibly facing the same issues.
... View more
Mar 28, 2013
12:29 PM
Essentially, Users select from a combobox which system they intend to use. 1 out of 7. Based on that dropdown, a bunch of other textedit fields appear and take in information about those options. Each are global properties. So unfortunately, they can select up to 4 machines. So we are now up to 7 possible types. Each of these types has it's own xml file. The master xml file sits in an outside directory. (But installed with the product also.) /Settings 7 xml specific files with multiple nodes. / 1 master.xml file. So let's say someone chooses machine 1 as their first machine, i need to grab the text from settings/machine1.xml and place it in master.xml and replace the values with properties set from the dialogs. Then they can select three more machines, which need to copy 3 more sections of xml into the master.xml file, and change their properties based on global properties also collected from the dialog. You guys are telling me this is all possible via xmlchanges section? What am i missing? lol... I've got the properties coming through customactiondata tokenized. No problem getting them over to the differed sequence. Just can't find a universal good way to do this.
... View more
Mar 27, 2013
03:25 PM
BasicMSI, I thought you retired Chris? If what i'm doing above can't be done in a Basic MSI, what's your method Chris? Can you be a little specific? The problem mostly is that i'm generating xml, not just changing it. I'm reading it from one file, and dynamically placing large chunks in another file based on conditions based on several properties.
... View more
Mar 27, 2013
03:13 PM
Hello All, I've been struggling with this for two days now. This ability is barely documented and it's very difficult to get any feedback. Essentially, i'm trying to replace some values in an XML file: function string FileStringReplacement(hMSI, sDestPath, sDestFile, sMachineDeviceName) OBJECT oDoc, Lot; NUMBER nvFileHandle, nvResult; STRING svString, szResult, szPath, szFile, szReplace, strTempString; begin set oDoc = CreateObject("Msxml2.DOMDocument.4.0"); oDoc.async = FALSE; oDoc.setProperty("SelectionLanguage", "XPath"); oDoc.load(sDestPath + sDestFile); set Lot = oDoc.selectNodes("/Device/@Name"); Lot.attributes.getNamedItem("Value").value = sMachineDeviceName; oDoc.save(sDestPath + sDestFile); set oDoc = NOTHING; end; The XML file: false false 5 Datascope.DatascopeDevice Datascope Nothing is happening. Any ideas? Please advise, i'm going insane over here... It's scheduled after the files are installed and it's running next to another custom action which is working. So i know it's not a scheduling problem. And i cannot use XMLFileChanges there is to much logic behind what i need to do.... TIA!
... View more
Labels
- Labels:
-
InstallShield 2012 Spring
Mar 22, 2013
10:10 AM
Would still like to report that bug, but.... I found a workaround to the writing extra last line and append issue. Use ListWriteToFileEX instead: ListWriteToFileEx(FileList, sDestPath + "\\DeviceLink.xml", LWTF_OPTION_APPEND_TO_FILE);
... View more
Mar 22, 2013
09:22 AM
So i tried ListReadFromFile and ListWritetoFile it doesn't duplicate that end tag. But, it also does use the FILE_MODE_APPEND either, so i get a file with just the text i wrote, it overwrites everything else in the file. This repeating of the last string in the list is certainly a bug. Is there a place i can log the bug?
... View more
Mar 21, 2013
09:47 PM
Hello Robert, Thank you for replying. I can always count on you. I have had a chance to try the sd.... but i can say that when i put a messagebox in the while statement, it does display the item twice. I'll try what you suggested here, but i suspect it's not going to make a difference. I wonder if there is some escape sequence in somehow? I just can't put my finger on it. I'll give it a shot tomorrow morning and see what happens.
... View more
Mar 21, 2013
04:07 PM
Hello All, I'm having an issue with a list, or maybe end_of_list and i suspect it may be a bug, either that or i have to set some indexing or something... The code below is simply copying text from one file and writing it to another. However, it duplicates the last line. Any ideas? It's driving me mad and i'm about to log a bug with Flexera. Please advise. TIA! OpenFileMode (FILE_MODE_NORMAL); if (OpenFile(nvFileHandleSource, sSourcePath, sSourceFile) < 0) then else //Create list of strings from file. FileList = ListCreate(STRINGLIST); while (GetLine (nvFileHandleSource, svLineSource) = 0) ListAddString (FileList, svLineSource, AFTER); endwhile; endif; //Open source file for setting strings. OpenFileMode (FILE_MODE_APPEND); if (OpenFile(nvFileHandleDest, sDestPath, "\\DeviceLink.xml") < 0) then MessageBox ("3 Opening of: DeviceLink.xml failed. Manual xml file configuration required.", WARNING); else nResult = ListGetFirstString(FileList, szFirstLineDest); WriteLine(nvFileHandleDest, szFirstLineDest); while (nResult != END_OF_LIST) nResult = ListGetNextString (FileList, svLineDest); WriteLine(nvFileHandleDest, svLineDest); endwhile; endif; ListDestroy (FileList); Here is the content of the file: false false 5 Datascope.DatascopeDevice Datascope And it's duplicating the at the end of the file. Any ideas?
... View more
Labels
- Labels:
-
InstallShield 2012 Spring
Latest posts by mumbles
Subject | Views | Posted |
---|---|---|
1045 | May 02, 2013 03:15 PM | |
1045 | May 02, 2013 09:29 AM | |
2182 | May 01, 2013 03:30 PM | |
1461 | Apr 11, 2013 02:46 PM | |
1461 | Mar 29, 2013 12:23 PM | |
1461 | Mar 28, 2013 03:15 PM | |
2152 | Mar 28, 2013 01:27 PM | |
2152 | Mar 28, 2013 12:29 PM | |
2153 | Mar 28, 2013 09:15 AM | |
2153 | Mar 27, 2013 03:25 PM |
Activity Feed
- Posted Re: Deleting unused files at end of Installation. on InstallShield Forum. May 02, 2013 03:15 PM
- Posted Re: Deleting unused files at end of Installation. on InstallShield Forum. May 02, 2013 09:29 AM
- Posted Deleting unused files at end of Installation. on InstallShield Forum. May 01, 2013 03:30 PM
- Posted Re: XPath and Installscript... on InstallShield Forum. Apr 11, 2013 02:46 PM
- Posted Re: XPath and Installscript... on InstallShield Forum. Mar 29, 2013 12:23 PM
- Posted Re: XPath and Installscript... on InstallShield Forum. Mar 28, 2013 03:15 PM
- Posted Re: XPath and Installscript... on InstallShield Forum. Mar 28, 2013 01:27 PM
- Posted Re: XPath and Installscript... on InstallShield Forum. Mar 28, 2013 12:29 PM
- Posted Re: XPath and Installscript... on InstallShield Forum. Mar 28, 2013 09:15 AM
- Posted Re: XPath and Installscript... on InstallShield Forum. Mar 27, 2013 03:25 PM
- Posted XPath and Installscript... on InstallShield Forum. Mar 27, 2013 03:13 PM
- Posted Re: Problem with List or END_OF_LIST on InstallShield Forum. Mar 22, 2013 10:10 AM
- Posted Re: Problem with List or END_OF_LIST on InstallShield Forum. Mar 22, 2013 09:22 AM
- Posted Re: Problem with List or END_OF_LIST on InstallShield Forum. Mar 21, 2013 09:47 PM
- Posted Problem with List or END_OF_LIST on InstallShield Forum. Mar 21, 2013 04:07 PM
- Posted Re: Multiple Installations on InstallShield Forum. Feb 12, 2013 09:13 AM
- Posted Re: Multiple Installations on InstallShield Forum. Feb 12, 2013 07:45 AM
- Posted Re: Multiple Installations on InstallShield Forum. Feb 07, 2013 12:44 PM
- Posted Re: .Net Scan at Build and .Net Framework File Location on InstallShield Forum. Jan 29, 2013 10:28 AM
- Posted Multiple Installations on InstallShield Forum. Jan 29, 2013 10:17 AM