Retrieving paths of DLLs included in and ISM file programatically

I have a project in the company I’m working, where I have to automate the collection of PDBs for certain .NET applications for which we deliver an MSI to our customer.

My team leader wants me to store only the PDBs of the DLLs going into the MSI. The MSI is built using the software Installshield 11 Pro. An ism file is given as input to it.

Is there a way to programatically retrieve only the paths of the DLLs added in the ISM file? This will help me to retrieve the PDBs from the same paths as well. Correct me if I am wrong in this approach.

Edit 1:- Sorry I didn’t make myself clear before. I’m new to software dev so please bear with me. As I said we use Installshield 11 Pro to build an ISM file that contains details of all the paths of the DLLs going into the MSI. This ISM file is used to build the MSI after all the .NET projects have been built.

Only some of the DLLs generated from the projects are used to build the MSI. So we wanted to store only the corresponding PDBs of those DLLs. As newer DLLs may later be added to the MSI using the ISM file I needed an automated process to retrieve the paths provided in that ISM file.

Correct me if this approach is wrong? Should I save only the corresponding PDBs of the DLLs going into the MSI or saving all the PDBs is recommended??

Add Comment
1 Answer(s)

Are you looking to iterate through the MSI file and maybe store specific files at runtime?

If you are looking to store the files at run-time, please take a look on the below script code that opens the MSI at runtime and iterate through the MSI File table and select the files under a spefic component:

try         {             session.Log("Begin GetFilesPath custom action");              // get folder path through its property             string folderPath = session["aFolder_Dir"];              List <string> filesPathList = new List<string> ();                          session.Log("Database open");             using (var database = session.Database)             {                 session.Log("Database openned");                 using (var view = database.OpenView(database.Tables["File"].SqlSelectString))                 {                     session.Log("File table openned");                     view.Execute();                                          //Get the files from table that are part of ||||OtherFileCopy2.txt||| component                     foreach (var rec in view)                      {                         if (rec.GetString("Component_") == "OtherFileCopy2.txt")                         {                             filesPathList.Add(folderPath + rec.GetString("File"));                         }                     }                     // List files in the log                     session.Log("The files that are assigned under the *OtherFileCopy2* component are:");                     foreach (var test in filesPathList)                     {                            session.Log(test.ToString());                     }                 }             }             session.Log("End GetFilesPath custom action");         }         catch(Exception ex)         {             session.Log("Error on GetFilesPath: {0}", ex.ToString());             return ActionResult.Failure;         }                 return ActionResult.Success;     } 
Answered on August 31, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.