private string getComponentFullDir(string component) //limited { Console.WriteLine("GetcomponentFulldir"); MsiComponent msiComponent = getComponent(component); if (msiComponent != null) { return(getTargetPath(msiComponent.Directory)); } return(""); //not null but emty string }
private void parseShortcuts() { WindowsInstaller.View view = queryMsi("SELECT * FROM `Shortcut`"); Record record = view.Fetch(); List <MsiShortCuts> shortCuts = new List <MsiShortCuts>(); while (record != null) { MsiShortCuts msiShortcut = new MsiShortCuts(); msiShortcut.ShortCut = record.get_StringData(1); msiShortcut.StartMenuDirectory = resolveMsiVar(record.get_StringData(2)); msiShortcut.Name = cleanShortCutName(record.get_StringData(3)); msiShortcut.Component = record.get_StringData(4); if (isAdvertised(record.get_StringData(5))) { Console.WriteLine("ishAdvertised..."); MsiComponent msiComponent = getComponent(record.get_StringData(4)); if (msiComponent != null) { msiShortcut.ShortCutTarget = getTargetPath(msiComponent.Directory) + getFile(msiComponent.KeyPath).FileName; Console.WriteLine("ishAdvertised with keypath..." + msiComponent.KeyPath + "::" + getTargetPath(msiComponent.Directory) + getFile(msiComponent.KeyPath).FileName); } else { Environment.ExitCode = 2; } } else { msiShortcut.ShortCutTarget = resolveMsiVar(record.get_StringData(5)); } msiShortcut.workingDir = resolveMsiVar(record.get_StringData(12)); shortCuts.Add(msiShortcut); record = view.Fetch(); } msiProperties.Shortcuts = shortCuts; }
private MsiComponent getComponent(string componentName) { WindowsInstaller.View view = queryMsi("SELECT * FROM `Component` where Component='" + componentName + "'"); Record record = view.Fetch(); MsiComponent msiComponent = new MsiComponent(); if (record != null) { msiComponent.ComponentName = record.get_StringData(1); msiComponent.ComponentId = record.get_StringData(2); msiComponent.Directory = record.get_StringData(3); msiComponent.Atribute = record.get_IntegerData(4); msiComponent.Condition = record.get_StringData(5); msiComponent.KeyPath = record.get_StringData(6); } return(msiComponent); }