cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
yozturk
Level 4

How to find dependencies?

Hi, we have been developing a software package using C# (.NET Framework 3.5). Our software package contains several softwares that uses mostly common dll' s. (Some of the commonly used dll' s are developed by our developers, some of the commonly used dll' s are DevExpress dll' s, some of the commonly used dll' s are Enterprise Library 4.1 dll' s.) So, I need to make a setup that copies commonly used dll' s to GAC.

I created a new BasicMSI project. Then I added one of the projects using "Add Project Outputs" button. Unfortunately, the dependencies of the project that I choose are not listed.

1) How can I list the dependencies of the project?
2) How can I transfer the dependencies of the project to GAC?

-Best regards.
-Yavuz
Labels (1)
0 Kudos
(10) Replies
mumbles
Level 7

The easiest way to do this is to not use the primary outputs. Unless you have a burning reason to use them.

Otherwise, use the .dll file itself in the /Bin directory.

Once you've inlcuded the file, go to the installation designer tab up top.
2. Expand the Orgonization folder.
3. Click on components. Expand
4. Find your DLL component, click on it.
5. On the right side, you will see desitnation, click in it for hte dropdown, select [GlobalAssemblyCache]
6. Next, look below: in the .Net settings .Net Scan at build = Properties and dependencies.

Give that a shot. Should work.
0 Kudos
yozturk
Level 4

Hi mumbles,

Thank you for your detailed reply. You are right, it worked. But unfortunately, the development phase of our software package has not been finished yet, the package is still under development. So, the dependencies of our software packages are changing continuously.

Note: If using "Add Project Output" button is not recommended, in which conditions should I use that button?

Before making the setup of a software, how can I list which dll' s the software package is dependent on, so I can remove unnecessary dependencies from the setup and then add the necessary dependencies to the setup? Any help from the "Install Shield development team" is also appreciated. Because, I believe that, instead of refreshing the dependencies manually every time before preparing a setup, there should be an easy way to refresh the dependencies of the EXE file, automatically. But how?

-Best regards.
-Yavuz
0 Kudos
mumbles
Level 7

Well when you scan for dependencies, it should pick them up. Can you use a tool like Orca to ensure they aren't being included in the package?

Secondly, there is such thing as 'dynamic file linking' go to the help in installshield and search on that term. You can dynamically pick up any files in a directory vs. specifying each file.

But i think you should put the onus on your dev team to tell you which files are needed and their dependencies.

If this is a .net application, usually you go through all the projects, go to the references and ensure 'Copy to Local' is set to true. Then once that is complete, copy ALL the files from the /Bin/Release directory.

Hope that helps.
0 Kudos
yozturk
Level 4

Hi mumbles,

Unfortunately, the trick you mentioned (CopyLocal) didn' t worked as I expected. Still, "dependency scanner" lists lot' s of "*** missing file ***" s and some dependencies are not included in the list at all. If the dependencies are listed as "missing" or are not listed at all, how I supposed to put them in [GAC] folder?

I use a free tool called "RedGate Reflector" and it lists the dependencies perfectly. So, I' m adding the dll' s that "Reflector" lists to [GAC] folder one by one.

When I am adding a dll to the setup, InstallShield asks if I want to search for the dependencies of this dll. When I press "ok", "dependency scanner" works and then says: "No new dependencies found" !!! But "Reflector" says that the dll that I am adding to the setup depends on lots of dll' s belong to Enterprise Library 4.1. What a shame???

Adding dependencies one by one is not feasible to me. I am sure that "static dependency scanner" has some bugs in it. Please show me a way, without using any kind of dependency scanners in InstallShield, is there a way to list the dependencies of "project output" s and put them in [GAC] folder?

-Best regards.
-Yavuz
0 Kudos
yozturk
Level 4

Hi mumbles,

Unfortunately, the trick you mentioned (CopyLocal) didn' t worked as I expected. Still, "dependency scanner" lists lot' s of "*** missing file ***" s and some dependencies are not included in the list at all. If the dependencies are listed as "missing" or are not listed at all, how I supposed to put them in [GAC] folder?

I use a free tool called "RedGate Reflector" and it lists the dependencies perfectly. So, I' m adding the dll' s that "Reflector" lists to [GAC] folder one by one.

When I am adding a dll to the setup, InstallShield asks if I want to search for the dependencies of this dll. When I press "ok", "dependency scanner" works and then says: "No new dependencies found" !!! But "Reflector" says that the dll that I am adding to the setup depends on lots of dll' s belong to Enterprise Library 4.1. What a shame???

Adding dependencies one by one is not feasible to me. I am sure that "static dependency scanner" has some bugs in it. Please show me a way, without using any kind of dependency scanners in InstallShield, is there a way to list the dependencies of "project output" s and put them in [GAC] folder?

-Best regards.
-Yavuz
0 Kudos
mumbles
Level 7

Yavuz,

Sorry to hear of your troubles. We have many references we need to include, but i like the control of putting them in there myself. The installshield dependency scanner is not accurate and doesn't functiont he way you would expect. It doesnt tie into all dependencies in Visual Studio.

So using the installshield one is not an option.

What i'm not understanding is this....

1. Go to your C# Solution, go to each project and each dependency and ensure the property 'Copy To Local' is turned on.

2. Build this solution.

3. Go to /Bin/Release folder for this solution (Assumes that all files output location is default and not modified)

4. Copy and use all the files in this directory.

Are you saying this is still too much work?
0 Kudos
yozturk
Level 4

Hi mumbles,

Even if I set CopyLocal properties of Enterprise Library dll' s to "true", they are not copied to the local folder. This is a problem.

As I said earlier, our software package is still under development and references of the projects are still changing. So, when a setup is needed, the solution you mentioned should be applied to all setup projects. In my point of view, preparing a new setup project (copying all files into setup project manually) every time is not feasible. I expect more comfort from a $ 4000 software rather than a buggy feature. But if it is the only way, I accept your solution, at least it is working.

Thank you for your attention mumbles. Thank your for being a medicine to my illness 🙂

-Best regards.
-Yavuz
0 Kudos
Lurean
Level 8

It is odd that the Copy local attribute is not working for one of the groups of DLLs. Even if that DLL is registered in the GAC on the current machine it should be copying them to the output directory. I suspect the people that developed that DLL did something to prevent this, but no clue what. Check the distribution methods approved by the company that made the dependency DLLs you are using to see if they have a runtime installer that should be deployed with your software.
0 Kudos
yozturk
Level 4

Hi Lurean,

The dll' s of "Developer Express" are copied to the local folder when CopyLocal is set true as expected.

However, the dll' s of "Microsoft Enterprise Library Ver. 4.1" are not copied to local folder even CopyLocal is set to true.

Anyway, currently I found a way to include dependencies in the setup project as I explained earlier.

Now I have a different problem. When I want to set the name of a RadioButton in a custom dialog, Visual Studio crashes and restarts.

At the end of 4 hours and nearly 25 restarts of VS, I decided to manually code the custom dialog using InstallScript. After these incidents, I doubt InstallScript compiler works fine...

-Yavuz
0 Kudos
foerdi
Level 4

No idea of that dependency scan or CopyLocal thing - seems very probably you have to file a bug or wait some IS geeks give more information to better understand the underlaying stuff.

For the RadioButton control, I really doubt that you can change its name without changes in RadioButtonGroup. If I remember correctly, Windows Installer doesn't take/see independent RadioButton controls, it just recognizes the whole Group as one control, unlike Windows.
So, i guess there's some showstopper when you play around with RadioButton control without the Group and the Group property... what's this thing with InstallScript (and VS)? Do you edit RadioButton name from a IS CA? I'm not that expert for IS plugin in VS, but can you please explain what you're doing

slm
0 Kudos