I am writing application for Windows Mobile 6.5, and for application to run, I have to install sqlce.wce5.armv4i.cab and NETCFv35.wm.armv4i.cab files on the end device.
Is there someway that I can combine and bundle those two cabinet files together with my application cabinet file? I want to create a single install process, which would install each file sequentially one after another (when I start bundled cabinet file)?
Is it possible? Or what is the easier solution to create more automated installation of required packages (such as for SQL Server CE)?
--
I am able to create cab file with other two cab files in it, but how can I make them execute right after I finish installing cab file that contains them? Right now it just extract them.
If I am right you are looking for Multicab Installation.
WM already comes with an example on this. Here is a reference.
The sample can be found on your PC at C:\Program Files\Windows Mobile 6.5.3 DTK\Samples\Common\CPP\Win32\multicabinstall
From what I have learned in the past, that can't really be done.
When I learned this long ago (back on some other site before SO came along), I was bummed and thought this was the dumbest thing ever.
Now, I keep those two files (plus another I use called NETCFv35.Messages.EN.wm.cab) on the same Network folder that my installing CAB file is located on.
Also, I install those files onto each device's Flash Drive, that way if one of our employees forgets to charge the battery and the device resets, I can quickly get the old WM5 device's CF upgraded to v35 and and get sqlce running.
Note:
Things may have changed! Someone may have learned a way to combine these CAB files into your project's cab file.
If you can do that, just keep in mind that every time you go to update your application, instead of your CAB file being 200k, it is going to have to be the combined size of all of the CABs.
You might run out of room!
Also, if one of your CAB files is going to be the NETCFv35.wm.armv4i.cab (at 2,644 KB), the device's OS has to reboot after installation. That would likely cause your program's CAB file to fail.
There may be a way around that, but not that I've learned.
Related
So, all the .exe files that I am creating from Microsoft Visual Studio keep on throwing an error message The file or directory is corrupted and unreadable when I want to run them. This is only happening in a specific Windows 10 machine. The same is not happening on other Windows 10 machines. I have tried to recreate the .exe both from VS 2017 and VS2019. I have also tried to create WPF, Win Forms and Console Apps. The issue remains, as long it is a .exe created from VS. Other .exe files, for example, .exe downloaded from the internet or the ones in the Program Files are running perfectly fine. I read about running the scs \scannow and still, the issue persists.
Anyone who may be faced this before and how you solved it?
This error is often a sign of disk/file system defects.
I'd try to move the compiled files out of this folder into
another folder, preferably on another (physical) drive. Then check
if it runs there.
If option 1 does not work you could then try to re-build the files into another folder, also on another (physical) drive preferably.
If one of both of the above solutions works, thats an indication you indeed might have FS/HDD trouble. Try running chkdsk /f c: on the offending drive to check for errors.
If this also does not work, try re-installing Visual Studio.
So, all the .exe files that I am creating from Microsoft Visual Studio keep on throwing an error message The file or directory is corrupted and unreadable when I want to run them. This is only happening in a specific Windows 10 machine.
As the problem only happens with one machine, it seems clear that something is broken on that machine. Either with the OS (unlikely), the IDE or Compiler Installation, or at least that speicific folder.
Edit: As the behavior follows the file around, we can asume it is not the OS. Only something with the build process.
You could try by removing that folder, then making a clean reinstall of the IDE and Framework. But the reliable solution would be to just reinstall that computer from the Filesystem upwards. This is the kind of bug you can spend days trying to debug and still not get anywhere. And even if you could fix it, could you realy rely on the computer to not have other criticial bugs? Maybe ones that do not show a helpfull error message?
As you already verified it happens on no other machines and it persits for any .exe created on this machine, it would at best be trivia to figure out what precisely is wrong. I can give you a rough idea:
Some file got binary damage while in ram or on disk. Either that file was the compiler, or a file that then went on the corrupt the compiler, or a file that corrupted the file that would end up corrupting the compiler. As we are not dealing with the kind of hardware that has to run a mars rover, guided missile system or nuclear power plant, those things happen.
The reason why I was experiencing the stated issue is because of the data transfer methods (Teamviewer, AnyDesk and Microsoft Remote Desktop) I was using to move files between the two computers.
I discovered that the issue was not only about .exe files. Any file I copied across to this specific Windows 10 machine that was giving an issue, I could not open it. It could throw the same error message. In this case, I accept that this an OS issue. However, I was not prepared to reinstall the machine.
So, to resolve the issue, I did use FTP to move the files between the two computers. I uploaded the .exe file to FTP Server from the one computer and downloaded the .exe on the other computer that was giving issues. Downloaded files could then open without any issues.
I have students in high school who have created some programs using Visual Studio C#. They created some games and would like to now upload them to the web. I am pretty new to Visual Studio C#. I thought after a program was "built" that you could go into the bin/debug folder and get the exe file for the program and be able to play the game without having to have Visual Studio on the actual computer you are playing it on. It works with some of their games but some of them, there are graphical files that are missing in the exe file if all the other files aren't stored in the same place. How can I get a clean exe of their game? Can that exe be loaded up onto a web server so they can play it from there or at least download it from there?
Microsoft wrote a guide on how to do exactly this. It's on their MSDN website, which is sort of like the developer back-bone for a lot of Microsoft software and documentation.
Old guide: Adding and Editing Resources (Visual C#)
Newer guide: How to: Add or Remove Resources
The gist is that the program needs to know where the files are, relative to the location of the compiled binary (in this case, an .EXE); There's several different ways to do this, depending on your level of expertise. I would suggest that you take a look at the guides above to start that journey.
there's a few ways of doing this. (Also, make sure you're creating a 'release' build when you compile).
You can include resources in your game by creating a resources file. This is something I usually do only on winforms applications etc.
If you have on-disk files you need to distribute those on-disk files along side your game. You could do this by zipping up your game.exe and the /files/images.img folder (or what ever your resources content folder is named).
If you're feeling adventurous you could create a 'deployment project' which is a project that allows you to create an installer file. This is a bit more work however you will have fine grained control over what files go where etc.
Good luck!
EXE files generally aren't self contained for video games with many resources, just add resources in an external folder and make sure the paths to the resources in their games are not absolute but relative in the local directory.
So for example:
get rid of paths like C:/Users/Bob/Desktop/Game/Images/player.png and replace with /Images/Player.png.
Also, an EXE generally doesn't run client side on webpages, it is possible but difficult. Things such as Flash are made for this sort of issue. I'd say make the webpage a place where they can download their games. Github has a nice way to do free websites called gh-pages. OFC, you could host one yourself but that would require a lot of setup work.
Like Monza said, you can zip up the files for download. Or, you could create an installer if you wanted to be really ambitious.
I thought after a program was "built" that you could go into the bin/debug folder and get the exe file for the program and be able to play the game without having to have Visual Studio on the actual computer you are playing it on.
That is correct, given that the other machine has the necessary .NET framework version installed AND any other resources like .dll files and config files are also present. When the application is ready for release, you can set the Build options in the project properties to Release, and then when you build all the files needed for distribution will be in the bin\Release folder.
It works with some of their games but some of them, there are graphical files that are missing in the exe file if all the other files aren't stored in the same place.
This may depend on how the application was written. If resources like pictures are embedded in the assembly then those files will not be needed to run on another machine. If the application is using hard coded paths for the image resources in the source code, then the application will likely break if the necessary files aren't present when the .exe is executed.
Can that exe be loaded up onto a web server so they can play it from there or at least download it from there?
Yes - you could upload the .exe to a file server to make available for a download, but you would not be able to run it within a browser over the web. I would recommend zipping up the .exe and other files needed and hosting the .zip file on the web server for download; browsers may give a warning or block downloading an .exe .
Hope this explains it a little bit for you.
I was wondering if it was possible to host a .exe file, that when downloaded has parameters associated with it, so once run can read them on the host computer.
I have looked into 'ClickOnce' with the xml manifest (similar to Java WebStart) but I am concerned about lack of native functionality in Chrome and Firefox (this is a must). I have also looked into storing it in the executable filename, but the 255 character limit concerns me.
I was wondering if there was any way to pass parameters to an executable that is downloaded from a website, where I am hosting the website?
Well, sort of.
Most executables that does something like this, tucks on some data at the end of the executable before it is downloaded. As such the executable reads its own file and finds the data at the end.
Adobe Creative Cloud uses this for instance. If you pick an application to install on the website, a small stub executable is downloaded, figures out if it has to install Creative Cloud shell application, and then launches it with information about which program to install.
I have a (crap) netbook that is given to all students in NSW, Australia in year 9. The thing is you cannot run executables other then the ones installed on the system due to a group policy. I have writen a program in java (and got eclipse working on it) that searches directories in C:\Windows and C:\Program Files that are writable. No locations are writable in C:\Windows, but in C:\Program Files there is a location which contains multiple executables which you can read/write. So I backed these up, then copied over Firefox portable (since we are stuck with ie7) and renamed the executable name to the one I backed up, but still can't run it. So now, I am assuming (and also checked in the registry) that when you run a program it is checked against a white-list, it not only checks the executable name and folder, but the files details (file description, copyright info, etc). So, I was wondering if it is possible to edit these file attributes by writting a program? And could anyone please provide me with source code examples on how I would do this, preferably in C#.
Any ideas? Thanks.
A Java application that kills explorer then starts it own version (assuming without polices applied) http://www.mediafire.com/?sf4t1iv1l4wbf68
We have an application that we wish to install just a basic shell for. As the users use it, it will download and install the necessary dlls for actions that need to take place (imagine a wizard application scenario with several possible paths). Currently, everything is installed for all possible paths through the shell app.
For about 3 months out of the year, the dlls used for the possible paths go through a high churn rate with updates, so we wish to start ensuring the users have the most recent version of these dlls. The idea is that after all their selections are made, we'd make a web check to see what dlls are required for their selection and check to make sure they have the most recent version of those files.
All of this we have a plan for on how to do it. The problem I'm fighting is what is the most appropriate way to "install" these files. ClickOnce is not an option...too much legacy stuff here. Our app is installed in "Program Files" which obviously has restrictions for writing random files into the program's install folder under Vista and later.
Right now I see the options as the following:
On install mark the install directory as writable for the "Everyone" group. I haven't actually tested to see if this would work yet, or if Vista does something different in this scenario.
Split the download portion out into a second app that we can have prompt for elevated privileges so that it can download and install these files.
I'm leaning towards the second option since that maintains the security aspect of the Program Files folder. Others in the group lean towards the first option because they just don't want to have to worry about things. Or is there some other option I'm missing?
The app is a .NET app, though it has some requirements of third party dlls that are not managed assemblies.
As long as the dlls you want to load are managed, there are several ways to do this.
One way is to designate an Environment.SpecialFolder path such as AppData and dynamically load assemblies into your appdomain from there. RssBandit does this for plugins, there is a special directory that loads dlls and searches for specific interface implementations, loads them into a temporary appdomain, and then calls them from the app. You could take this one step further by using an IoC library like ninject or structuremap.
you could also try MEF, the new extensibility framework coming out in C# 4.
Personally, I like what Firefox/xul apps do. It's a hybrid of your two proposed solutions, I suppose. They have an updater.exe that lives in the install directory. I assume that means that the install directory is made writable during install so that they can run the update application. However, having never deployed a application in this manner, I can't tell you how much of a headache (or not) it is.
An alternative which you haven't mentioned, and may not know about, is using the .Net download cache. When you attempt to load an assembly you can give it a code base to load from. If you set the codebase to a web url (i.e. http://mywebhost/mycoolapp/) .Net will download the assembly from that url if it's not found in the download cache. It will also grab the latest version of the assembly from the web url if there is one.
This approach can be a pain as you'll likely have to deal with CAS security issues if your app needs elevated permissions. However, it is nice not having to write code to download the latest versions of your assemblies for you. If you want more information, I can find some resources and give more detailed examples.
The way I handle it is to have an update.exe installed into program files next to the main .exe file.
Then, on app startup, I have the app download an xml file off of the web and save it in the App Data folder. This file contains the latest versions of the dlls and has a simple Filename, Version structure.
Run through the list of filenames and if you don't have the dll locally or you have an older version, then add the needed dll to an update list.
After you generate your update list. Fire off the Updater.exe with a command line list of the files to be updated. You don't have to write them to program files but I do. On Vista, my updater pops up the UAC prompt correctly (as it should to maintain Program Files' security).
The updater then downloads the files to Program Files and restarts the main app.
One problem with firing off the second app is that you have to give it a manifest with "AsAdministrator" set in it.
This isn't hard to do, but once the updater is done and retriggers the main app, it cannot start the main app with normal privileges. An exe running as administrator can only start other exe's as administrator also, even if "AsInvoker" is set in the manifest. I don't know why you can't restrict it back to normal rights...you can only elevate permissions for some reason...