I have built a windows application on VS2012 (C#) with the following features
1. Codes accessing pictures from project resources folder.
2. Codes accessing other multimedia (like videos, txt, sounds, etc) using something like: addr = #directoryName + "\\videos\\*.mp4".
Hence, I've added few folders in my Debug folder which I require to be in the same directory level as my main .exe file. All works fine on the debug mode, and even while running the .exe without debug mode.
Then I created my application setup (a 1.8GB setup file including all resources needed) using Inno Setup Compiler and it works like magic on the same computer, but not on another.
I was then curious whether the problem is with the setup or the .exe. So I tried copying the whole project folder into another laptop of mine, ran the .exe file on the debug folder, but nope, nothing came. Checked the Task Manager and found out that my .exe was running for 5 seconds under the Processes Tab, then it just disappeared.
(Similar to the problem stated here: Not able to run the .exe file created from c#).
Note: .NET Framework 4.5 have been installed perfectly on the other machine and all files needed have been copied.
So now I'm faced with two major issues:
- First, my .exe is not running on another machine.
- Second, which folders to include on my setup file as I do not want to include the .cs files and the other source codes. Just enough for my users to run my app flawlessly. Tried Inno (best one), InstallShield and had a quick glance at WIX.
Any help will be greatly appreciated. Been working, searching and doing trial and errors on making the setup file for almost 2 weeks now. Thanks in advance!
Regards,
Ken
Related
i have a somewhat big project, its a background application for windows and i was testing it out on my other computer. I copied and pasted the .exe from the debug folder and ran it. I opened task manager and it would stay running for a few secs until it stopped responding and quit.
I then decided to move the whole VS folder for that project and ran the .exe while it was inside and it worked perfect. Normally just copying the .exe to a usb or something and running it will work perfect. I am also using 3 external librarys which are located in the debug folder too, is that why it only runs while the .exe is in the folder with them? Would it be possible to kind of finish my project into 1 .exe file to use?
If anyone has any ideas on why this is happening, id appriciate it :)
I have a WPF application that is going to be installed on several client PCs. I'm using InstallShield Express Edition as the deployment tool for that.
I've created a different project(DLL) to keep track of the software installations. Basically is a stand-alone C# project that reads, writes and does some validation checking in the Windows Registries, and can be integrated in other WPF applications (this project/DLL is going to be useful for other Apps).
What I want to do is to create an .EXE file to register the installation. This .EXE is not used in the main WPF application, but uses the .DLL that I've just talked about above.
I've managed to do that by creating a different solution with a single Console Application project, and referencing the necessary DLL's.
But what I really want is to create it as project within my Main App Solution, and when I do that no .EXE file is generated other than the Main App executable.
Is there anything I can do to get the 2 .EXE files (Main App and InstallationRegistration) or is the way I'm currently using the only way?
This is more a nuisance than a problem, but still... it will be a better way to keep track of this small module in all the different Applications I've developed.
Thanks
Are you saying the Console EXE is not created as part of the build/run of the solution?
Or the Console EXE is not created as part of the InstallShield deployment project?
If you are referring to building Console EXE as part of the build/run of the solution:
Generally, when you hit F5, Visual Studio builds only those projects you designate as Startup and their dependencies.
You will have to explicitly build that Console App or the Entire Solution.
You can designate it as one of your Startup projects if you want it to be built everytime you hit F5; or specify it as a dependency of the MainApp project (that's a bit of a cheat but it gets the job done).
After trying for a few different ways I got to that DUH!!! moment.
What happened is that VS was creating both .EXE files for the Main App and the Console Application, only with each one is in their respective Debug/Release Folder
For Example:
Main App -> C:\Projects\MyApp\MyAppUI\bin\Debug\MyAppUI.exe
Intallation Control.EXE -> C:\Projects\MyApp\InstControl\bin\Debug\InstControl.exe
NOTE: C:\Projects\MyApp is the solution folder.
It kinda makes sense they are on their own folder, but on the other hand, there should be an option in VS to choose where we want to send all the solution's .EXE
Hope it helps someone in the future.
By default, all intermediate compilation artifacts are placed in the obj folder under a given project in the solution (so far I am not aware this can be changed).
For project outputs they are, by default, put under bin\Debug or bin\Release depending on your Build Configuration.
This can however be changed from the Project's Properties; specifically the Build tab has an "Output path" option for you to specify the build output location.
This has to be done on a per project basis but I generally create a SolutionDir\bin folder under the Solution root and direct all project output paths to SolutionDir\bin\Debug or SolutionDir\bin\Release as the case may be. This has the added advantage or reducing the total size of SolutionDir by avoiding multiple copies of output assemblies in large solutions with complex interdependencies between projects.
Does this help?
So I have created a little C# game using XNA and would like to be able to show it to a few people and therefore ideally send it to them. As they're not great with computers I'd like to just simply be able to send them and executable file which they open and automatically runs the game. When I go into the debug folder in my project I find the executable file of my game, however I can only double click and run the .exe when it is in that file. If I drag it out onto the desktop and try and run it, it doesn't open and then eventually I get an error pop up saying 'BouncingBallGame Has Stopped Working'.
Could anybody help me as to why this could be, or am I going about it the wrong way completely and do I need to publish the project in visual studio or something?
Your game will need two things to run:
The appropriate .NET Framework to be installed on the target machine.
To have its supporting files with it. You'll notice that in the debug folder that it's not the only file. The executable needs all of these files too.
As mentioned by System Down
.exe file needs ..NET Framework to be installed on the target machine
& To have its supporting files with it.
or you can make a installer file of your project which will install your game into the host machine.
you can find a good Article here which shows how to build a installer file for your project.
I have C# Windows form application that works perfectly when I debug it in VS.
It has SQLite database.
Then I've created a new Setup project, using InstallShield.
Visual Studio 2012 compiles it and I install application with no error.
But application is slow, when I change user controls or do any action, even to just construct a form, it takes a few seconds.
Very very slow, not for using... And I don't even have any critical code, like loops or something...
In setup project I included: .exe.config, .exe, SQLite.dll and .s3db (SQLite database file)
Please help
Thanks
Though this is an old thread, but it will be helpful for other people who comes this post via googld. The solution I discovered to solve this issue, in my case is I executed the application as Administrator and everything was fast.
Hope this helps
I know this is several years old but it's one of the SO posts I saw before finding the correct answer. The reason you have to run the application as Administrator is probably because you're trying to read/write from a file such as a SQLite database file. You have to have elevated privileges in order to read/write from Program Files and Program Files(x86). I found the answer here:
Integrating SQLite with a Windows application
Basically, you'll need to save your files to another directory, preferably the AppData folder on your Windows machine. You can get there by using:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
This will put the files in the Roaming folder of AppData.
Hope this helps someone.
I have developed a windows application on C# in Visual Studio Express 2010. Now I want to deploy it.
I used publish to deploy but when I run the project it get error on the form where I have used some external files which I am using for I/O operation, read and write files.
How do I resolve this error? I am also using one folder for files.
I'm a big fan of using WiX for installers - even if you've got Visual Studio Pro with the built in MSI creation tools
http://wix.sourceforge.net/
the benefit of WiX is that you can do most anything, from the super simple to very complicated. The tool is great b/c you can get started quickly and then move up (adding dialogs, etc) as your app gets more popular.
One trick for installers - consider using VMWare/HyperV, install a test OS then take a snapshot of the OS before you install your app. IF everything works, great - you're done. However if something isnt right, roll the OS back to the pre-install snapshot, fix the bug, and try it again.
Add those external files to the project
Right Click the external files in your VS Set the Build Action as Content
Copy to Output directory to CopyAlways
Then try deploying
That may be due Windows 7 UAC permissions. Despite the fact that current books, msdn and even the snippets in Visual Studio teach methods of file IO, most are not correct when taking UAC into consideration.
All of your file operations should take place in UAC safe zones such as
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
You cannot read or write to files in the C:\Program Files (x86) directories unless you have elevated your app to run with higher privileges.
If you install your application and right click the executable and select Run As Administrator and everything works the problem is UAC.
If you haven't coded around UAC limitations I highly recommend reading up on it. It will save many headaches down the road.
http://www.codeproject.com/Articles/17968/Making-Your-Application-UAC-Aware