Hi all,
can anyone tell me how can i add an assembly to the GAC without
using Visual Studio Command Prompt?Is there a manual way like copy
and pasting? I know that using gacutil -i AssemblyName command in
the command prompt i can do this.But i need an other way to do
this.Any ideas?
Thanks in advance.
Installers, like WiX, are the way to go if you want to deploy your application.
I am not sure why you don't want to use the command prompt, but if you are looking on how to do it in code you could use the method GacInstall from the System.EnterpriseServices.Internal.Publish class.
new System.EnterpriseServices.Internal.Publish().GacInstall("YourAssemblyName.dll");
If you need more control you should look at the GAC/Fusion API. See here for an example written in C# for a PowerShell module controlling the GAC.
If all you want is a tool other than gacutil, then please use one that does use the proper APIs and does not manipulate the folder structure directly. Like this one for example.
Without using gacutil, may be you can try creating folder structure as mentioned below and copy your assembly there,
c:\Windows\assembly\(YourAssemblyName)\(FullVersion)(PublicKeyToken)
Finally copy YourAssemblyName.dll to the above folder.
Related
So, I'm coding a chat, and I'm testing it over 2 computer, I've setup a box folder so when I drop the builded.exe in it the other computer have it available.
My question is : is there anyway to put it automatically in a specified folder every time I build the program?
Use a post build script. This is just a Windows batch (aka. command) script. You can easily set it to copy from the output folder (VS adds macros so that does not need to be hardcoded) to wherever you can access.
As others mentioned you can use post build event for that. You can use something like below in the post build event to copy the build output to the location you want.
copy $(TargetPath) "c:\Output"
I need to create an exe installer that accepts command line switches.
I'd like to call my installer with some custom command line switches which it can then use accordingly. For example I'd like to be able to specify the destination for install using say something like /S=\path\to\install and other options like \debug for installing debug builds and so on.
I don't have prior experience with packaging software for Windows so I am a bit lost.
I've tried the iexpress installer that comes with windows, but I couldn't do what I was trying to with it. I'm also looking at http://www.advancedinstaller.com/ but that doesn't seem to have options for something like this either.
It is highly likely that either of these have the capability but I'm missing out on how to use it. But either way I would like to know how I can accomplish creating an exe installer with custom command line flags
Start with WiX, http://wix.sourceforge.net/ , you need to learn it first, and then author your packaging using XML syntax, and then build your exe (self extractor) or MSI.
MSIInstaller.exe comes with many options, and it does help you pass command line arguments to your installer package, which is the out put of your WiX authoring.
I know I will miss so much of Visual Studio but I am getting really sick of it crashing all the time and being slow, PLUS it is always changing things in my repository that I don't want to change, so I want to just edit with Notepad++. However, now I will have to load up VS just to build things. Is there a way I can build from command line and make a script for it and what not? Will it show the compile errors?
Please don't try to troubleshoot VS for me, I am just asking what is in the question and the rest was just given for context and so nobody was like 'Y U NO RIKE VIZAL STUDIA?'.
build: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "PATH TO YOUR SOLUTION FILE"
help: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /help
What you need is directly calling csc.exe, the C# compiler (which is called by the build system of Visual Studio, anyways). If you ever worked with GCC, it is quite similar except that options are passed Windows-style with / signs instead of -- and there are no object files or additional linking. The MSDN library has documentation: http://msdn.microsoft.com/en-us/library/78f4aasd.aspx.
Generally, you'd need something like:
csc /target:exe /out:Something.exe *.cs
plus any /reference's you would add in Visual Studio.
If your project is large, it may be uncomfortable to maintain a .bat file to do the compilation, so a build tool like NAnt may be needed, which is quite similar to the Ant used for Java.
This is of course if you want to eliminate Visual Studio entirely. Otherwise, Snowbear's solution of invoking MSBuild.exe will be just as fine.
I have Java application, export to runnable .jar and then convert that .jar file to .exe file.
I need to create installation for windows ( .msi file ). Can anybody suggest me good program ( easy add icon and other settings ) for that task ?
Taken literally there is no such thing as an EXE to MSI 'converter'. What you are probably trying to ask for are repackagers.
Repackaging Applications For Distribution
Now that you've revised your question, you don't need to repack an existing EXE based installer, you just need to create an installer. This is an exact duplicate of
How can I create a .msi file for a Java program ?
The best program I know for that is Installshield, is not the only program but you can custom everything.
If you would like to research a little bit you have a list here
http://en.wikipedia.org/wiki/List_of_installation_software
I can recommend you this website: EXE to MSI Repackaging Knowledge Base. I has few articles that explain how to repackage EXE to MSI.
Not a converter, but you may want to take a look at Stall. It's an OSS project that lets you install your app via the command line, without having to configure anything.
Disclaimer: I wrote it. Please enjoy!
I want to create a template kind of thing where there will be more than one project in the solution. Like one test project + one normal project + some other project.
How to do that.
When I export a template it exports only one project.
We had to resort to a powershell script to do this, as we couldn't find a reliable way of doing this.
This is fully supported but you'll need to modify the .vstemplate file manually. Starting by running the Save as Template on each project is a good first step. Now you need to bind them together in another .vstemplate. More information can be found here:
http://msdn.microsoft.com/en-us/library/ms185308(v=vs.80).aspx
Have you tried this: http://visualstudiogallery.msdn.microsoft.com/57320b20-34a2-42e4-b97e-e615c71aca24