This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Excluding Installshield Deployment Projects from MSBuild
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 08, 2015
10:19 AM
Excluding Installshield Deployment Projects from MSBuild
I need to exclude a few deployment projects (used for development only) from my build (using MSBuild from command line) and have not been successful. I have tried both of the following (separately) in my InstallShield.targets file with no difference.
[ExcludeDeploymentProjects]
[ExcludeDeploymentProjects]
How can I prove that the InstallShield.targets is even being used? I uncommented the 'Message Text' lines, and I see no messages. Are the messages supposed to appear on the console or in the log files?
Thanks for any advice!
How can I prove that the InstallShield.targets is even being used? I uncommented the 'Message Text' lines, and I see no messages. Are the messages supposed to appear on the console or in the log files?
Thanks for any advice!
(11) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 11, 2015
12:21 AM
Hi there,
Please correct me if I'm wrong, but I am under the impression that what you are trying to do applies to Web Deployment Projects in Visual Studio.
I don't think that the InstallShield.targets knows what to do with the items.
So, I'm a bit confused about your question.
Do you want to tell us a bit more about what you are trying to achieve and what type of project you are working on?
As for the logs, you can add a task pretty much in any target you want. See here for more info: https://msdn.microsoft.com/en-us/library/6yy0yx8d.aspx
If you build your project by calling MSbuild from the command line, your message will appear in the console window.
If you build your project with a build server, it will appear in the log file.
But you need to set the right verbosity level either as parameter of your msbuild command (/v:diag), or by setting some attributes of your build definition when launching a build.
The verbosity level is directly related to the importance of your message: the message task has an "importance" attribute. Have you tried to set it to "high"?
I hope that helps.
Please correct me if I'm wrong, but I am under the impression that what you are trying to do applies to Web Deployment Projects in Visual Studio.
I don't think that the InstallShield.targets knows what to do with the
So, I'm a bit confused about your question.
Do you want to tell us a bit more about what you are trying to achieve and what type of project you are working on?
As for the logs, you can add a
If you build your project by calling MSbuild from the command line, your message will appear in the console window.
If you build your project with a build server, it will appear in the log file.
But you need to set the right verbosity level either as parameter of your msbuild command (/v:diag), or by setting some attributes of your build definition when launching a build.
The verbosity level is directly related to the importance of your message: the message task has an "importance" attribute. Have you tried to set it to "high"?
I hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 11, 2015
10:12 AM
Thanks Reureu,
I agree..." is not applicable in my case. I have several InstallScript MSI projects in my solution. Our developers only have InstallShield LE on their machines and some of the InstallShield projects are for use only by the developers. Those projects are not part of what we distribute with the product. When I do an MSBuild I specify the solution as part of the MSB command line. This builds ALL the .isproj files in the solution. I need to exclude some of the .isproj files. How do I do that?
Thanks.
I agree...
Thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2015
12:15 AM
I think your question is more related to Visual Studio than InstallShield, but here we go...
Why don't you create several solution configurations, then set the projects to build for each solution configuration?
So let's assume you have the following solution/project structure (see image 1)
Now, you go in the configuration manager, and create some more solution configurations, all based on the "Release" solution configuration, like Release01, Release02, Release03.
Then you set which project to build for each solution configuration (see images 2, 3 & 4)
Now, you need to pass the solution configuration as "Configuration" property on the command line:
You should see the following lines in the output:
Does that help?
Why don't you create several solution configurations, then set the projects to build for each solution configuration?
So let's assume you have the following solution/project structure (see image 1)
Now, you go in the configuration manager, and create some more solution configurations, all based on the "Release" solution configuration, like Release01, Release02, Release03.
Then you set which project to build for each solution configuration (see images 2, 3 & 4)
Now, you need to pass the solution configuration as "Configuration" property on the command line:
msbuild /t:Build /p:Configuration=Release01 MyDeploymentSolution.sln.
You should see the following lines in the output:
Does that help?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2015
03:49 PM
Reureu,
Thanks for the explanation. I already have several configurations as you described, have excluded projects from some, and am specifying the right configuration. The ones generating the errors are .isproj files that are used for development, but not included in the release. The build completes without errors if built from VS. When built from MSBuild command line it gets errors on the unneeded .isproj files. I would just like to get rid of the errors so they don't obscure the results.
Thanks
Thanks for the explanation. I already have several configurations as you described, have excluded projects from some, and am specifying the right configuration. The ones generating the errors are .isproj files that are used for development, but not included in the release. The build completes without errors if built from VS. When built from MSBuild command line it gets errors on the unneeded .isproj files. I would just like to get rid of the errors so they don't obscure the results.
Thanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2015
12:04 AM
Why don't you show us the error messages you are getting?
Or even better create a dummy solution that shows the error and attach it to this thread?
Or even better create a dummy solution that shows the error and attach it to this thread?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2015
08:22 AM
Thanks Reureu,
The error message is
MyPath\MyProjectName.isproj(30,2): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\InstallShield\2013Limited\InstallShield.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk
"C:\Program Files (x86)\MSBuild\InstallShield\2013Limited\InstallShield.targets" is not on this machine because this machine has the full version of InstallShield. Limited is what the developers have. I tried copying ..\2013\InstallShield.targets to ..\2013Limited\InstallShield.targets, but that generates other errors. The real problem is that this .isproj file should not be included in this configuration (it is unchecked in configuration manager). Seems like all isproj files in the solution are loaded whether they should be or not.
I also sent you a PM.
The error message is
MyPath\MyProjectName.isproj(30,2): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\InstallShield\2013Limited\InstallShield.targets" was not found. Confirm that the path in the
"C:\Program Files (x86)\MSBuild\InstallShield\2013Limited\InstallShield.targets" is not on this machine because this machine has the full version of InstallShield. Limited is what the developers have. I tried copying ..\2013\InstallShield.targets to ..\2013Limited\InstallShield.targets, but that generates other errors. The real problem is that this .isproj file should not be included in this configuration (it is unchecked in configuration manager). Seems like all isproj files in the solution are loaded whether they should be or not.
I also sent you a PM.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2015
02:02 PM
I faced a similar problem as some of my colleagues are building the solution as me, but I am the only one who has got an InstallShield license (given the price, my employer thought 1 IDE license would suffice).
So the ISPROJ was building fine on my machine, but not on my team-members' machines.
Here is a description of one possible resolution. Unfortunately, I don't have the files with me right now and I might not remember everything, so take this description with some caution.
To solve my problem, the idea is to import the right InstallShield.targets file if it is present, and import a dummy targets file if it isn't. This dummy ".targets" file contains a "Build" target that only displays a message.
So here we go:
The only remaining problem is a message that Visual Studio displays when opening the solution on a machine that does not know what to do with ISPROJ (ie a development machine without any InstallShield installed), but it's something we can live with.
In any case, you can easily reuse the idea to resolve your problem:
So your imports in your ISPROJ would look like this:
HINT: Instead of copy-pasting the whole path of the target everywhere in your ISPROJ file, you could define an MSBuild property.
So the ISPROJ was building fine on my machine, but not on my team-members' machines.
Here is a description of one possible resolution. Unfortunately, I don't have the files with me right now and I might not remember everything, so take this description with some caution.
To solve my problem, the idea is to import the right InstallShield.targets file if it is present, and import a dummy targets file if it isn't. This dummy ".targets" file contains a "Build" target that only displays a message.
So here we go:
- I created a NoInstallShield.targets file and saved it in the same folder as the ISPROJ. I don't remember the exact content, but this NoInstallShield.targets file mainly contains one "Build" target that displays a message. Useless to say, I added this file to the source-control.
- Now in the ISPROJ file:
- I added a condition to the import element, something like:
It means the InstallShield.targets is only imported if it exists. - Then I added the following line, just below the import I've just mentioned.
This one imports the NoInstallShield.targets if the InstallShield.targets file does not exist.
- I added a condition to the import element, something like:
The only remaining problem is a message that Visual Studio displays when opening the solution on a machine that does not know what to do with ISPROJ (ie a development machine without any InstallShield installed), but it's something we can live with.
In any case, you can easily reuse the idea to resolve your problem:
- Import one InstallShield.targets file if it exists
- Import the other InstallShield.targets file if it exists.
- If none of them exist, import a dummy target file.
So your imports in your ISPROJ would look like this:
HINT: Instead of copy-pasting the whole path of the target everywhere in your ISPROJ file, you could define an MSBuild property.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2015
02:15 PM
Looks like I can make it work the way I want it to by changing
to
That will cover the 3 cases, true false, and empty.
to
That will cover the 3 cases, true false, and empty.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2015
02:22 PM
Even better! I didn't even know about this MSBuild property!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 14, 2015
02:40 PM
I had trouble with my solution listed 2 posts back, so I implemented Reureu's suggestion as follows.
Made a copy of InstallShield.targets and named it NoInstallShield.targets. I edited that to look like this:
Then I went to the appropriate.isprojfiles and changed
to
This is working well.
Thanks Reureu
Made a copy of InstallShield.targets and named it NoInstallShield.targets. I edited that to look like this:
C:\Program Files (x86)\InstallShield\2013\System
Then I went to the appropriate.isprojfiles and changed
to
This is working well.
Thanks Reureu
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2015
04:02 AM
If I were you, I would remove any reference to InstallShield.Tasks.dll. This file is not present if InstallShield is not installed.
It is also a good practice to define the "Clean" target in your NoInstallShield.targets.
This allows to call MSBuild with the "Rebuild" target.
This leads to the following NoInstallShield.targets:
I would also place this NoInstallShield.targets file in the same folder as the ISPROJ, and check it in under source control, otherwise, you will need to copy it manually on every developer's machine. But that's only my humble opinion.
It is also a good practice to define the "Clean" target in your NoInstallShield.targets.
This allows to call MSBuild with the "Rebuild" target.
This leads to the following NoInstallShield.targets:
I would also place this NoInstallShield.targets file in the same folder as the ISPROJ, and check it in under source control, otherwise, you will need to copy it manually on every developer's machine. But that's only my humble opinion.