brad0999

I have a .wav file and .exe file in my resources. When I install my program on other computers it won't play the .wav file and it won't open the .exe. How do I make my install so that it installs my resources with it

Re: Visual Basic Express Edition Installing Resources

spotty

If it wont open the .exe file then that may account for it not playing the wav file.

The exe requires that .net framework be installed on the machine - so simply copying the exe to another machine would result in .exe not working. The best way to get and application to work outside of the development environment is to create a deployment package by publishing the application.

The underlying technology is called clickonce deployment and is rather neat as it ensures that required components such as the .net framework are installed on the machine prior to running the application.

To see more about how this works - a great webcast

http://www.dnrtv.com/default.aspx showID=8

Other than that you need to provide considerable more details such as error message that are occruing. It wont open is really not that descriptive.





Re: Visual Basic Express Edition Installing Resources

DMan1

If you have them stored as internal resources then you will have to write them out as a file before using them...the easy solution is to add them to your project as an existing item and set the build action to none and the copy to output directory to copy if newer...this will include the file as an external resource...and then you can reference the files through Application.StartupPath




Re: Visual Basic Express Edition Installing Resources

brad0999

I've added them both as an existing item, set the build action to none and the copy to output to copy if newer. Then I tried using Application.StartupPath in my code. It works when I debug it but then when I publish and run it I get an error when the .wav is suppose to play and when the .exe is suppose to run. That part of my code looks like this:

My.Computer.Audio.Play(Application.StartupPath & "\psycho 01.wav")

Process.Start(Application.StartupPath & "\alphattack.exe")

What am I doing wrong





Re: Visual Basic Express Edition Installing Resources

DMan1

Make sure you have added them to the project as "Existing Item" and that you have them set to copy to output directory.




Re: Visual Basic Express Edition Installing Resources

brad0999

I've added them as Existing Item, set the copy to output directory to "copy if newer" and the build action to "none." I've also tried setting the build action to "content." Shouldn't I just be able to add them to my project has resources and have them work that way I've tried and been unsuccessful but it seems like I should be able to do that. Also did you notice if there was anything wrong with the part of the code I gave you last post I've never used "Application.StartupPath" before so that could be wrong.



Re: Visual Basic Express Edition Installing Resources

DMan1

...Set build action to "Content" when using the publishing option..

As far as using them as resources...the exe...would have to be written out to file before using it...and you are using application.startup correctly......Setting the files to content should correct your problem