I have created a simple wpf application in c# with only one window, MainWindow.xaml. There is no database, not even textboxes, not a single line of code added by myself.
file structure wpf project
I also created an MSI setup project:
setup project
Building of either project works without problem. However, after installation, when I try to run the programme crashes without any error message. All that I see is that the circle-turned cursor is spinning and the windows explorer window can no longer be closed.
Operating system is Windows 10. Anyone has had a similar experience? Looks like a bug in the MSI installer.
Check all the .dll's are included in the installer. Often not all of them are and you need to manually include them. You can compare what's in the install (C:\Program Files...) directory compared to what's in the project bin directory. Often times items like "PresentationFramework.Aero.dll" aren't included and you get a missing .dll error.
If this is the case, you can copy over some of the .dll's until it works. Then add those to the installer.
Related
I've just finished my Windows Forms App project in Visual Studio using C#. I know I need to release it. To do so I need to go from Debug mode to Release above in VS and then just click on F6. After that I have a folder with an exe file in it. But in my project I use a dll library which was copied on my PC and registered by regsvr32.exe in cmd. Next in VS I went to Solution Explorer and added the library in References by writing the path to it. I also use two packages which were installed by NuGet Package Manager.
My program is developed to use it by my coworkers so I have to distribute it to them. The problem is that I don't know how to prepare my app for it.
I'm reading lots of different articles about the release step but I'm getting more confused. People usually write that I can just copy the exe file in the release folder and use it in another PC after installing .Net there. But in my project there are also the three libraries and without them my program won't work in another PC. I can copy and register the first library on other computers but what about the last two? How to set up them correctly?
About the first library, I put it in a folder created by me manually in the C directory of my computer. The release folder is in another place. And when registering this library in cmd and then adding it to References, I specified the path to it. It means if the path has been changed, it won't be possible to use the library in the project. I tried some times. It's not convenient and when placing the app in another PC without VS where I can specify the path, my program won't probably work. So it would be very convenient to place this library next to the release folder and after putting it in another PC, the path to the library wouldn't cause any problems.
To sum up, I'm looking for the way to easily and conveniently distribute my program to users. Of course, I want to put my app and the libraries together in a PC, not to set up them separately and then tune them separately to make the program work there. Might there a way to release it as an app with all the libraries connected to it?
I feel it must be easy but I'm not so experienced. I'm sorry for that.
It is recommended that you use ClickOnce deployment:
ClickOnce deployment is a Microsoft technology that allows you to easily deploy your Windows Forms App along with all its dependencies. With ClickOnce deployment, you can publish your application to a web server or a file share and users can install it by simply clicking on a link. ClickOnce will automatically download and install all the required DLLs and packages on the user's computer.
Of course, there are some third-party packaging software that I can't recommend. If ClickOnce doesn't help you, I'll think of other ways.
I have a Setup Project for my winforms application. After installing the application using the generated .msi i navigate to the installation folder and try to run the .exe file and nothing happens. I don't get an error or anything.
Steps i've tried to solve my problem.
Making sure the target platform x86 matches in the main project, setup project and every other project in the solution that the application has a dependency on.
In the setup project, made sure that i have a project output in the application folder that references the primary output from the main project. And that the dlls i use also are listed there.
Ran the application as administrator.
Activated Click Once security settings in the main project.
Ran sfc /scannow without finding any issues.
Restarted my computer.
When installing the program using the generated .msi on another computer i have the same issue.
When running the program from visual studion it works perfectly fine.
It is likely that your application is crashing because of some missing dependency.
Possible reasons:
A missing assembly (say, for eg, is all your third party dependencies present in the application folder after the installation ?)
Difference between .Net framework versions between your machine and the installed machine (say, for eg. 4.7 vs 4.7.2)
One useful tool that has helped us in the past is to use the Windows Event Viewer. If the program is indeed crashing, it is likely to have details about the reason for crash.
You can then use it as a starting point for further investigation.
I have created single layer windows form application and added one Visual Studio Install Setup Project to create the installation wizard using Visual Studio 2013.
So my application contains one .exe file and number of .dll files (SQLite, EntitiyFramework, etc) and other publish items. I am trying to Obfuscate my code using ConfuserEx.
For that, first I have created the publish build using my Visual Studio 2013.
Using ConfuserEx, obfuscated my publish .exe file. This step was working fine. I tried to decompile the obfuscated .exe file and got the unreadable code files. So that means, the process works fine.
Then I have replaced the obfuscated exe file with release exe file (..\bin\Release\appName.exe).
Then, rebuilt the installer setup project to generate the setup.exe file.
Then I have installed the software using setup.exe. Installation was success.
Decompiled the installed application exe using .NET Reflector 9
Decompiler shows the exact source of my project. So that means something is wrong in the obfuscation process.
Anyone know how to fix this issue?
I find the issue.
I was replacing the ..bin\Release\AppName.exe file instead of ..obj\Release\Appname.exe
Now it is working fine.
Thanks.
I have tried your way, it worked for one time only. I found better and easier way to solve this issue as such:
In the VS installer choose the primary output folder, right click.
Choose exclude filter. form exclude filter window, Choose add
filter.
Write down your program.exe.
Now select your VS installer project, right click.
Choose add File.. Browse toward your confused exe.
After building this, the confused exe will be installed.
It work well with me
I have tried your way, it worked for one time only. I found better and easier way to solve this issue as such:
In the VS installer choose the primary output folder, right click.
Choose exclude filter.
form exclude filter window, Choose add filter.
Write down your program.exe.
Now select your VS installer project, right click.
Choose add File..
Browse toward your confused exe.
After building this, the confused exe will be installed.
Tried and tested all above ways, Failed -> Now look at this way: (A Smaller one)
In the VS installer choose the primary output folder, double click.
Choose your program.exe and remove it. (YES remove it)
Now select your VS installer project, right click.
Choose add File..
Browse toward your confused/obfuscated exe. -> Select it.
After building this, the confused/obfuscated exe will be installed.
the issue in above similar solutions is:
When you exclude the exe it will not include the executable file at all.
So you simply need to remove the exe generated from the project output and replace it with your obfuscated exe.
Thanks.
I'm very new to Setup project in Visual Studio, I've just tried creating a one, it deployed my files as I configured in the setup project. But after testing the install file (.msi), there was something I can't understand:
There is no entry in the Add/Remove programs list in Control Panel but I tried re-running the setup and it showed a dialog saying that I couldn't setup because there was another version which has already been installed in the target computer, I should uninstall that version first, but I couldn't find an entry in Add/Remove programs and there is also no uninstall.exe file. I tried searching for all entries which contains my application executable file name in Registry and deleted these entries but It still shows me that dialog. (There must be some way through which it can detect another version installed on the target machine).
How I create an uninstall.exe for my deployed application in Setup project??? I thought it should be created automatically for me when I build my Setup project.
Your help would be highly appreciated. Thanks.
There is no uninstall.exe when you are using msi packages to install applications. If you double click the msi of an already installed application you get the choice to do a repair or an uninstall.
What name did you give to your installation package? Maybe you left the default name or gave it some "weird" name different from your application and that's why you can't find it. In 7 you can sort the installed programs by install date and check what's been installed last, don't remember if it's possible in XP.
So I made a C# program, and its great and all (its a Windows Form Application). The issue with it, is I don't know how to use it outside of the debug mode form. How do I publish it? My target goal is to create a two folders, put a shortcut to the application in one, along with the other folder which will contain the application and all outside programs (some of the buttons link to batch files). Then I'd want to be able to put it in a RAR compressed file, and upload it online for others to download it.
How do I publish it so that happens? How do I take it out of debug mode?
Go into your project folder, then navigate to /bin/Release. If there's an EXE file with the title of your project in there, copy it somewhere (along with any DLLs that you may have linked) and there's your program. If it's not there, first try Build -> Compile Solution in Visual Studio. If it's still not there, navigate instead to /bin/Debug and do the same thing. Then, copy all your batch files into another folder, put them into the same folder, and RAR it.
P.S. Try not to use RAR, few people can extract them. Use ZIP or SEA (self-extracting archive) if at all possible.
First off, you need to build your application in Release mode, in Visual Studio simply change the drop down near the top of the window to "Release." This will create a bin/Release directory where your sources are located. The folder will contain an EXE for your application and DLLs you need to include. It could (and probably will) include some debugging *.PDB files that you do not want to include -- as those include debugging information.
Copy the contents of that directory somewhere and RAR it up.
Building in x86 Mode
(You should only do this if you have a specific reason to)
If your application uses 3rd party DLLs that are not 64-bit compatible, you may need to do a release build in x86 mode. To do that, click the "Any CPU" drop down and click "New Configuration" (or something like that) and follow the steps to add x86. Then build with the x86 -- Release setting. That will output x86 binaries to a bin/x86/Release folder where your sources are located.
The Preferred Soltuion
Most users are going to prefer some form of automatic installer instead of a simple RAR or ZIP. Visual Studio (Standard/Pro) can create self installing MSIs that do all the work for you. A basic overview is here. You can add shortcuts/etc using the wizards Visual Studio provides.
If you need an even more robust installer you could check out solutions such as InnoSetup or NSIS
To build your application in Release mode instead of Debug, go to the Build menu and select Configuration Manager.
Change the Active soluction configuration to Release. Now, when you build your solution, it will put the executable in the /bin/Release folder.
If you need to automatically perform certain actions once the solution is built, like packaging into a RAR or ZIP archive and copying the distributable to another folder, then check out post-build actions.
After Visual Studio 2010 , Microsoft remove Make setup utility facility from the visual studio and,we have to downlorad that plugin seperatly from
Get InstallShield Limited Edition for Visual Studio
You Have to fill the application
After intalation, goto
Visual Studio-->New Project-->Other Project type-->Setup and Development
You will see follwing screen
Now you can goto InstallShield setup utility and change the things as you requirement.
add all file in debug folder of your project in follwing interface and build solution,
Final setup will locate in your setup folder-->Express\CD_ROM\DiskImages\DISK1**
hope this will help you