Can i move files to different component in Advanced Installer? - advanced-installer

I have an Advanced Installer project.
In "Files and Folders" I have 3 folders
Client, Addon, Services.
Now in the "Organisation" of Advanced Installer I dont see the same directories as in files and folders. The files are organized by versioning.
Can i reorganize them or make the folder in "Files and Folders" be recognised so that I can put a condition on installation ?
So I only want to install if the user has selected the check box to install it.

Yes, this is doable but you should manually configure this in "Organization" view of your Advanced Installer project. Just expand (click on > sign) the current features and components and then just drag and drop the file resources from one component to another.
- more details about component management in Advanced Installer

Related

How can I force file ordering in F# projects using vscode?

I'm trying to work with vscode in my WebSharper project (Ionide plugin seems... Whoah!) but when I load the fsproj into vscode, files in the explorer are ordered by name, not by "F# precedence". How can I configure vscode so that files are correctly ordered? Thank you.
The VS-like project explorer has been added to Ionide recently. It includes assembly references, project references, and ordered files (including folder supports). We've also added several commands to manipulate project and file order, you can access them with right-click context menu on this new project explorer
In Visual Studio Code you press Ctrl + Shift + P, then enter "F#: Move File Up".
If you have activated the great ionide plugin you can navigate to the F# symbol on the activity bar. This will open the project explorer which allows you to reorder files using the arrow icons:
This will change the order of the files (<Compile Include="xyz.fs" /> statements) in your .fsproj file (which is what you would have to do manually if you're not using the ionide plugin).
Without any plugin, VSCode 1.66 (March 2022) should support a better order support.
See issue 32592:
ordering of files is really important for the F# projects, and we provide couple of helper commands to manage it (move file up/down etc).
Those commands work more or less, but I don't think it's best UX.
I think it would be super nice if users had ability to use normal drag and drop to manipulate the order - just as they are able to manipulate files in normal file explorer (drag and drop files to move them to subfolder for example)
It is currently released in VSCode insider, with commit c468903 ("Finalize tree drag and drop API").

How to prevent TFS from ignoring files

In a project I'm working on we check in Ruby with sass in order to compile scss files during the build. I switched to using a local workspace when updating gems so that changes are detected automatically. This works great except for the fact that files for new gems that reside in a bin folder are always ignored.
I have no existing tfignore files so I wonder is there some global ignore list that I could potentially edit or override.
I've tried adding a tfignore file at the root and even at the same level as the bin folder in an effort to force team explorer to stop ignoring those files but have had zero success thus far.
The content of the tfignore file is just one line:
!bin
How can I get team explorer to detect these changes automatically so I don't have to go through the extra step of finding and adding these files manually?
Bin and Obj folders are never shown in the project and adding files within those directories require some kind of manual step. If your goal by "not adding them manually" means you don't want to add them through "Source Control Explorer" but would just rather add them while working with a solution and project through "Solution Explorer", then you can click the "Show All Files" icon at the top of VS 2013/2012/2010.
This will then show you your potential bin/obj folders you may want to add files from:
Then you just right-click and include them. Once they're included, when you go to check them in, TFS knows you intend to add them to source control so it will show up in the Team Explorer pending changes window, if you are checking in from a higher-level in tree hierarchy. If you're not, then you can go to the "Excluded Changes" to find pending change you want to include in your final change.
If items are being excluded in anyway, try removing the .tfignore files and depending on your version of Visual Studio and settings, you may also be excluding your files through options such as this:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\AddOptions

How to organize CSS,JS and other files into ASP MVC 4

I am totally new to ASP.NET MVC 4 as I was developing into PHP (Laravel) and the way to organize things is usually something like a "public" folder which would then be separated into css, img, js, lib, and so on.... which is the way I prefer to organize my files...Trying to follow this into ASP MVC 4, and I found and read this question that is similar to what I want achieve. organizing custom javascripts in asp.net mvc 4I did it the way they said and added my custom JS files and added them in the Bundle, it compile and also run fine but the problem I have is that inside the Solution Explorer all the files that I moved are showing with an exclamation mark and also my newly created folders (directly in file explorer, not doing it through VS) are not showing by default, they are for some reason hidden, which I can see with Show All Files. I made sure that they exist inside the Bundle but then my Solution Explorer does not get refreshed. I am trying to make a structure that looks the following:
Contents
img
ui-icons.png
css
bootstrap
bootstrap.css
bootstrap.min.css
Scripts
lib
bootstrap
bootstrap.min.js
bootstrap.js
jquery
jquery.js
jquery.min.js
jquery.ui.js
jquery.ui.min.js
modernizr
modernizr.js
custom
mycustom.js
mycustom2.js
I am not crazy about dumping everything inside the same folders (Content & Scripts), including my custom files in between some official libraries. I know using directly the File Explorer is probably not the best way to go, but then what would be the official way of configuring these... and actually does my structure make sense into ASP MVC4?
EDITMy question is more related to why after creating and moving the files like jquery and others into a Scripts/lib folder, my Solution Explorer is still showin these files under Scripts but with an exclamation marks as saying file not found (of course since I moved them). Why it doesn't reflect exactly what I see in File Explorer? Apart from editing the Bundles is there anything else I'm suppose to do so that my Solution Explorer is up to date with reality??? and why are my created folders not showing in Solution Explorer, why do I have to click on Show All Files to see them? The commmand Create New Folder is not even enable as an available command, that's why I have done these folders directly in File Explorer...but why?
Frankly, you can organize your MVC project however you see fit. If there's anything close to an "official" way to organize your web files, it would be how the default Visual Studio MVC4 template organizes them:
Content (CSS files and related image files)
Images (general image files)
Scripts (JavaScript files)
If you're more familiar with another sort of organization or are part of a team that would prefer another organization, then go for it. (Though in that team scenario, make sure all the team members follow the same organization rules!).
Edit:
To alter the folder structure that the MVC template provides using the Solution Explorer, right-click on the folder in which you want to add a subfolder (this includes the project name, for project-level folders), and then select Add and then Add Folder from the pop-up menu that appears.
If you want to move around files that are already in your solution to another location within the solution, you should move them around using the Solution Explorer, not Windows Explorer, as you'll otherwise get the behavior you are experiencing, where Visual Studio does not know where you moved them. You can click and drag files around, right-click and copy and paste, etc.
If you need to add pre-existing files to your solution (say, to include a set of custom scripts), you can copy the files to the appropriate project folder using Windows Explorer. Then, in Visual Studio, highlight the project that corresponds to where you moved them, and press the Show All Files button in the Solution Explorer toolbar - this will show the files you copied in Windows Explorer, which otherwise won't be listed in Solution Explorer tab. Lastly, highlight the new files, right-click, and select the Include in Project option from the pop-up menu.
One final pointer: if you need to add a specific JavaScript library to your project, the easiest way to do so would be to use the NuGet package manager, rather than to download and add the files in Windows Explorer. This option is found in Visual Studio in the Tools menu, under Library Project Manager --> Manage NuGet Packages for Solution. Not all JavaScript libraries will be available this way, but the most popular ones are.

Prevent other users from geting a file in TFS 2010?

Is ther a way in TFS 2010 to prevent other users from perfroming a get on a config file that is only to be avaliable for the build process?
Each user is supposed to have their own versions of the files on theier own workstations.
BR
Johan
There are a couple of ways to do this.
you can get each developer to "cloak" the file in their workspace.
Open Source control Explorer and select the "WorkSpace" dropdown
Select "WorkSpaces"
Click on the Edit button
in the "Working Folders" area at the bottom of the screen add a new row, The Status should be "Cloaked" and the "Source Control Folder" should point to the folder or file you want to ignore (you can only navigate to a folder in the "Wizard" but you can add a file manually)
Using Security permissions
Navigate to the file in source control explorer
Right click on the file and select "Properties"
Select the "Security" Tab
Uncheck the "Inherit Security settings" check box
Remove the Group that contains your developers (Unsually the [Team Project]\Contributors group)
The downsides to these approaches
1. The Devs will have to do this on each machine \ workspace they are using.
2. The devs may accidently try to check in the file, this will cause an error.
If you do both then you'll mitigate the problem with the devs checking the file in accidently as it will be cloaked, but you'll still have the issue of each developer needing to set up the cloaked file in every workspace.
Alternatively you could have a "special" version of the file checked in to a different location in source control ,which is copied in to the correct location (overwriting whatever the devs have checked in), as part of your build process.
you can give rights
from source code security tab.
u have to add the person or group in Global Groups And after that you can give any rights from security tab!

How do you share scripts among multiple projects in one solution?

In case the question wasn't clear. I have 3 MVC projects in one Solution. Every time I create a new project it adds the "Scripts" folder with all the .js files I'll ever need. I don't want to have this created every time for every application. Is there a way to reference scripts from a central folder in the solution so all applications/projects can share one common script folder with all the scripts common among them?
Edit:
Please explain the pros and cons of doing this if there are any...now I'm curious.
Here is what I would recommend:
Right click the solution and create a New Solution Folder called Common Javascript Files (or whatever you feel like calling it.
Right click on the Solution, click Open Folder in Windows Explorer,
or navigate there manually for other versions of Visual Studio :(
In the solution directory, create a directory with the same name as the solution folder (solution folders do not normally match directories at the source code level but this will for sanity sake).
In this new directory, add files that need to be shared between solutions.
In Visual Studio, click the solution folder and select Add - Existing Item.
In the file selection dialog, navigate to the directory previous created, select the file(s) added to the directory and click Add.
In each Project that needs a shared file, right click on the project (or directory within the project) and click Add - Existing Item.
Navigate to the shared Directory, Select the files and click the drop down arrow then click Add As Link.
Now the files in the projects are essentially short cuts to the files in the Solution Folder. But they are treated as actual files in the project (this includes .CS or Visual Basic files, they will be compiled as files that actually exist in the project).
PROS
Files are truly shared across projects at Design time
Only the files needed for each project can be added, it's not all or nothing
Does not require any configuration in IIS (virtual directory etc)
If the solution is in TFS Source control, you can add the Directory to the TFS Source and the shared files will be source controlled.
Editing a file by selecting it in the Project, will edit the actual file.
Deleting a Linked file does not delete the file.
This is not limited to JS files, linked files can be ANY file you might need (Images, Css, Xml, CS, CSHTML, etc)
CONS
Each deployment gets it's own file.
There is a small learning curve when understanding that Solution Folders are not Directories that exist in a Solution Directory.
The best thing to do, imo, is to roll your own CDN... Basically just create another site in IIS and give it it's own binding, e.g. "http://cdn.somedomain.com"
Then store all of your css/js/fonts/shared images etc on the CDN site and link to them from your other sites.
Doing so solves 2 problems,
All of your stuff is shared when it needs to be and you only have to manage 1 revision per file.
Your users browsers can cache them in 1 single location instead of downloading copies of your stuff for every site that uses them..
I added this answer because I see a lot of people referrencing creating virtual directories. While that does indeed share the files, it creates multiple download paths for them which is an extreme waste of bandwidth. Why make your users download jquery.js (1 * number of sites) when you can allow them to download it once on (cdn.somedomain.com).
Also when I say waste of bandwidth, I'm not just talking about server bandwidth, I'm talking about mobile users on data plans... As an example, I hit our companies HR site (insuance etc) on my phone the other day and it consumed 25mb right out the gate, downloaded jquery and a bunch of stuff 5 times each... On a 2gb a month data plan, websites that do that really annoy me.
Here it goes, IMO the best and easiest solution, I spent a week trying to find best and easiest way which always had more cons than pros:
Resources(DLL)
Shared
images
image.png
css
shared.css
scripts
jquery.js
MvcApp1
Images
Content
Shared <- We want to get files from above dll here
...
MvcApp2
Images
Content
Shared <- We want to get files from above dll here
...
Add following to MvcApp1 -> Project -> MvcApp1 Properties -> Build events -> post build event:
start xcopy "$(SolutionDir)Resources\Shared\*" "$(SolutionDir)MvcApp1\Shared" /r /s /i /y
Here is explanation on what it does: Including Build action content files directory from referenced assembly at same level as bin directory
Do the same for MvcApp2. Now after every build fresh static files will be copied to your app and you can access files like "~/Shared/css/site.css"
If you want you can adjust the above command to copy scripts from .dll to scripts folder of every app, that way you could move some scripts to .dll without having to change any paths,here is example:
If you want to copy only scripts from Resources/Shared/scripts into MvcApp1/scripts after each build:
start xcopy "$(SolutionDir)Resources\Shared\Scripts\*" "$(SolutionDir)MvcApp1\Scripts" /r /s /i /y
This is a late answer but Microsoft has added a project type called Shared Project starting Visual Studio 2013 Update 2 that can do exactly what you wan't without having to link files.
The shared project reference shows up under the References node in the
Solution Explorer, but the code and assets in the shared project are
treated as if they were files linked into the main project.
"In previous versions of Visual Studio, you could share source code between projects by Add -> Existing Item and then choosing to Link. But this was kind of clunky and each separate source file had to be selected individually. With the move to supporting multiple disparate platforms (iOS, Android, etc), they decided to make it easier to share source between projects by adding the concept of Shared Projects."
https://blogs.msdn.microsoft.com/somasegar/2014/04/02/visual-studio-2013-update-2-rc-windows-phone-8-1-tools-shared-projects-and-universal-windows-apps/
Info from this thread:
What is the difference between a Shared Project and a Class Library in Visual Studio 2015?
https://stackoverflow.com/a/30638495/3850405
A suggestion that will allow you to debug your scripts without re-compiling the project:
Pick one "master" project (which you will use for debugging) and add the physical files to it
Use "Add As Link" feature as described in Eric's answer to add the script files to the other projects in solution
Use CopyLinkedContentFiles task on Build, as suggested in Mac's comment to copy the files over to the second over to your additional projects
This way you can modify the scripts in the "master" project without restarting the debugger, which to me makes the world of difference.
In IIS create a virtual folder pointing to the same scripts folder for each of the 3 applications. Then you'll only need to keep them in a single application. There are other alternatives, but it really depends on how your applications are structured.
Edit
A scarier idea is to use Areas. In a common area have a scripts directory with the scripts set to be compiled. Then serve them up yourself by getting them out of the dll. This might be a good idea if you foresee the common Area having more functionality later.
Most of the files that are included by default are also available via various CDN's.
If you're not adding your own custom scripts, you may not even need a scripts directory.
Microsoft's CDN for scripts: http://www.asp.net/ajaxlibrary/cdn.ashx

Resources