How to write script for vs.net setup? - c#

I have an exe, now I want to deploy this so I have written setup in vs.net. And i have added two check boxes, " Launch the application " and " Set as startup " , but my question is how do I handle the these two events ? As for as i know i need to write the Script to validate and execute according to the input given by the user for these two actions.
Can some one tell me whether i am right or wrong?, if I am right then which script is the easier one? and please let me know the steps to accomplish my task.
Thanks in advance,
Ravi Naik.

Hmm... Well my first question to you is - Why are you using VS.Net setup? It is not the friendliest setup on the planet, and nor it is the most efficient. Ask yourself, how many professional programs use VS.Net setup?
Now my advice to you - Use Innosetup. With very slight modifications to the standard script it supports .Net framework. It's compact, very lightweight, very efficient and very-very tested.
There will be a little investment required in learning how it works (cause it don't have no fancy GUI), but once you've put in a couple of weekends you'll never want to go back to anything else.
Oh, and did I tell you that it has excellent scripting capabilities in a Pascal like language and that you can get ready sample code for practically everything?

Related

Tracking All Code Usage In ASP.NET Web Application

I have been tasked with taking an existing asp.net website that has many lines of code and projects and redesigning it. I would like to know if anyone has any ideas on how to track every method/property that gets called when users are on the site. I would like to identify the code used the most so that I can know what I should carry over to the redesign, and what code is not used at all and can potentially be removed completely. Many thanks in advanced. There are both vb.net and c# projects in the solution, so any solution would have to support each language. Also, any free/oss solutions are the best for me right now.
I am currently using VS.NET 2015 Community, if that helps. :-)
You can do it in multiple ways:
Introduce some method level tracing by using some AOP framework (like PostSharp). In this case, you can log the method call chain of one specific request. Then you can start from there.
If your app backed with SQL Server, enable profiling and look through all SQL queries executed from one request. Then you look back to codebase and refactor them.
Use CodeMap to understand code base and do it.
You can use ReSharper. Right click the project and select 'Find Code Issues'. You will see 'Unused Symbols' to show which components are not being used.

Easy update assistance

We are writing simple architectured software in C# 3.5.
What I was searching for is for easy updating framework/application...
We don't have COM components, Servicdes to install or whatever, so basically what we need is xcopy stuff form one Server side directory to the client. So what the program should do is like a workflow:
Check some location \Server\Updates for manifest.xml
Check the local setup verison
Download all available DLLs (doesn't necessary all need for complete application, so kind of patch stuff) and substitude them with "old" ones.
I'm aware of ClickOnce, of App publishing, also our setup generator supports autoamtic updates (even if noone yet used it, and I don't want to use to not strongly couple ourselfs with that technology).
Do you know some app or technology, that I'm not aware (actually listed in question) which could better fit our needs. ?
Thank you in advance.
So, after the comment, the answer:
I would look at this SO post.
I looked wyWuild and the AutomaticUpdater controler some time ago. It really looked great.
EDIT
I just remembered that I chose to use AppLife Update in the end. It's more expensive but the features are extremely good

Multilanguage development

I would like to develop an application with two languages.
Actually, the goal is to generate two differents application, one with a language (Java), the other on in another language (C#).
I would like to use makefiles to help me generate one application or the other one, thanks to targets definition.
I don't know where to begin.
Have you ever try to develop like this ?
Is it possible to use one makefile to call java compiler or c# compiler using different targets ?
Thanks in advance for your help.
Sure, you can use a make file to compile (and link) source files for different languages. There's no limitation. All you need is a compiler (linker) that can be called by a shell / from a command line.
Alternatives: ant can do both Java and C#. If you don't need to build both applications with a single build file, you still can use separate files and write a batch/shell script to call both builders.
Yes it is possible to override a Makefile variable to point to either javac or the .NET compiler.
You will, however, most likely not benefit from this as it is very hard to write a program that is valid in both languages.
You may want to look into http://www.ikvm.net/ which provides a Java emulation environment under .NET, so if you have a Java program it can run under .NET.
There is also the Fantom project, which claims to do that, but I have strong doubts regarding cross-platform support (how can you abstract all side-effects of all APIs?).
But I don't know the project, maybe they do a fine job.
http://fantom.org/
my idea is pretty dumb but i guess you could try this:
step 1: make a bat file
step 2: make the 2 script files
step 3: make it so it executes both of them!
#echo off
start yourfile.script
start yourfile.script
this idea is gonna fail

what are the different componenets needed to produce and sell an application in C#?

I need some help with my knowledge of .NET !
ive always created applications using C#(for fun), i also have knowledge in C, however i have some unanswered question and ive been searching for days!
once i create my form and my application is running fine, do i need to add a class of any sort to programeName.cs file? and why (i breifly know why but i need to understand exactly why, and when is it a must) ?
when im finished with the application design and my previous question is answered; what do i need to do to sell the application? do i just burn a CD with the .exe in it?? :S
i guess my question would be, what are the different componenets needed to produce and sell an application? is it really as simple as just creating a windows application form that works??
Cheers
Your question is really about two things:
Technical completion
Distribution
You don't need to do anything special, short of perhaps building in release mode rather than debug mode, to have a product ready to ship. You can do extra things, but don't need to. If you want to package it up in an installer application such as an MSI then you can, which makes distributing and installing easier for end users. Alternatively, depending on your audience, zipping it and telling users to xcopy it might be sufficient.
In terms of distribution - burning cds is out. Use the internet. If you're really solving a paint point for customers, and there is legit need for your app then customers will come. How do you get traffic to your site? Blog about it, (ideally in advance), find a few important blogs in the same vertical, with good readerships, and insert yourself into them. Add insightful comments, and post a topic expanding on it in your blog, and link to it. Build SEO, get inbound links etc.
If you application is running fine then you shouldn't need to add anymore code. Now, you might want to create an installer package. This is preferable to just have the plain executable as it will aid in creating Start menu shortcuts and so forth. However, if your app is very simple, you may just want an exe; it really depends but people usually create an installer. You can create a simple one within Visual Studio.
As far as selling, there are some other things like building a web site and using some sort of payment vendor. A lot depends on your specific needs and goals.

System Testing a desktop application

I've got a desktop application written in C# created using VS2008 Pro and unit tested with Nunit framework and Testdriven.net plugin for VS2008. I need to conduct system testing on the application.
I've previously done web based system tests using Bad Boy and Selenium plugin for Firefox, but I'm new to Visual Studio and C#.
I would appreciate if someone could share their advice regarding this.
System testing will likely need to be done via the UI. This gives you two options:
1) You can manually conduct the test cases by clicking on elements.
2) You can automate the test cases by programming against the UI. There are plenty of commercial tools to do this or you can use a programming framework like the Microsoft UI Automation Framework. These tend to use the accessibility APIs built into Windows to access your UI.
Whether you go the manual or automated route depends on how many times you will be running the tests. If you are just going to run them once or twice, don't spend the time automating. You will never earn it back. If you are going to run them often, automating can be very handy.
A word of caution: Automating the UI isn't hard, but it is very brittle. If the application is changing a lot, the tests will require a lot of maintenance.
As Thomas Owens commented on your question, first you must decide what kind of system testing you want to do. But assuming you want start with Functional System Tests. Prepare use cases you want to automate. Than you must find proper tool.
Just for start:
AtoIT – is not test atomization tool but it lets automate some tasks. So you could record/script use cases. Not really recommended, but can be done.
HP QuickTestPro – easily can be done with this tool via recording/scripting but it is expensive, so maybe not worth it for personal use.
IBM Robot – as HP QTP.
Powershell – you could write scripts in powershell and execute them. If you would use dedicated ide-like tools for powershell you could record test also. I did some web automation via powershell and it worked. With a bit of work probably you could script around your desktop app.
And the best would be to try different tools, and use one that suits you best. Try this link and this link.
System tests usually have use cases, end to end scenarios and other scripted functions that real people execute. These are the tests that don't lend themselves well to automation as they are asking your unit-tested cogs to work with each other. You might have great unit tests for your "nuts" and your "wrenches" but only a comprehensive system test will let you know if you have the right sized wrench for the nut at hand, how to select/return it from/to the drawer, etc.
In short - manual tests.
If you're willing to put money down, you could look at something like TestComplete.
Although I haven't really used it yet (our company just bought it), it seems quite nice. You can record clicks and keypresses and stuff, define success criteria, and it will replay the test for you later. It appears to be quite smart about UI changes - it remembers which button you clicked, not just the (x,y) of each click.
It's scriptable, or drag-and-drop programmable.
I'm not affiliated in any way, and this is not an endorsement, because I haven't really formed an opinion of it yet.
Perhaps NUnitForms could be useful for you?

Categories