i am building a windows 8 store application that will connect to some backend feed. I have all the code in place - but i need to create a package for our test environment and for the production environment. They will obviously use different URLs.
In a normal windows forms/console application i would have one version of the binaries and two app.config files which would host the URLs. As Windows 8 is created as a pacakge - is there any way to have such a config that is not included inside of the package but stored separately and installed during setup? For now the app will not go to the windows store but will be delivered manually to a few devices.
Thanks in advance.
There is no app.config file associated with a Windows Store style app. You could however add an XML file to your app package and access that at runtime with conditional compilation and the ms-appx protocol. But, you would be without all the nice utility functions associated with an app.config.
Related
I'm totally new to the windows phone 8.1 app development.
I'm trying to develop a simple app with a database using visual studio 2013. It is not a silverlight app.
my app just have a text field and a button.And i have a MySQL database in a local server(WAMP).
I need to get a input from the text field and store it in the database.
First thing that I want to know is it possible to do?
If it is possible I would be very grateful if you could provide a step by step guide or a link where i can learn about this.
If it is not possible what are the other ways that I can try to store my input in a database?
Local storage
I'm guessing you're looking for a way to store structured data locally on the phone. AFAIK, MySQL is not supported on Windows Phone (MySQL is big, runs as a server, and it wouldn't be possible or practical to "install" it onto a phone). Instead what Microsoft endorses is to use SQLite. You'll first need to download the SQLite library as a Visual Studio extension. Then you'll need to install something like SQLitePCL (from NuGet) which essentially wraps the native SQLite library so that it is accessible from .NET languages. Make sure you add both references to your project. SQLite stores a database as a file that you can put in the local storage for your app.
Remote storage
I'm not sure if it's directly possible to connect to a remove MySQL server from a WP app. Usually you'd access a remote database through a webserver that exposes an API for you to use (e.g. a REST API). You can then send data to the webserver via a HTTP POST request, and then your webserver will store the data in the database. This is a big topic, and involves knowledge of server-side programming such as ASP.NET, Ruby on Rails, Django, PHP, etc. This topic is too broad for me to give you specifics on how to do this. See this answer.
There are several questions on StackOverflow about the same topic, but I haven't found the solution.
In my Windows Phone 8 App I store user settings in the IsolatedStorage.ApplicationSettings.
This works great, I use IsolatedStorage.ApplicationSettings[key] = value to set my values and ofcourse use IsolatedStorage.ApplicationSettings.Save() to save them.
I have also created a database using a .sdf file to save local data.
When I use the Deploy function in VS2013(Visual Studio 2013) to update my app, the isolated storage settings will remain.
However, when I have used the Rebuild or Clean function in VS2013, the isolated storage will be whiped on the next deploy! Resulting in the deletion of all local data and usersettings.
Why does this behavior occur?
A work-around would be to not use these functions, I could basically do all my work from development to deployment without using Rebuild or Clean. But when I would (accidentally) use these functions I would be unable to deploy without whiping all local data on the devices.
This behavior also occurs when I upload my App to the Windows Phone Beta Store. (I haven't used the live store yet)
UPDATE:
Thanks to robwirving I have some new insight: XapDeployCmd.exe
This is a tool that can perform all the deployment tasks that Visual Studio normally does for you, in command prompt. The relevant actions are installlaunch and update.
I think VS performs an installlaunch action when the deployment process detects the project has been rebuild. However, if I use the update action with XapDeployCmd on a Xap build by Visual Studio, which has been Cleaned and Rebuild, the isolated storage is NOT whiped.
Could it be that the Windows Phone Beta Store mimics this behavior?
The default behavior of Visual Studio is to do a fresh install instead of an update when it has detected a rebuild. As far as I know this is not configurable.
You could do a rebuild and then update your XAP without deploying through Visual Studio however. Here is the documentation for XapDeployCmd, a command line tool included in the Windows Phone Dev tools that allows you to install or update a XAP from the command line. http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402565%28v=vs.105%29.aspx
When You perform Clean Solution Visual Studio Cleans all the data related to Project and all related linking to the .dlls and other linked data. It serves as cleaning of all Generated files and data so Ultimately you loss your local data.
In the Case of Rebuild Solution Visual Studio Regenerates files and data that you are using with that Solution so In the Process of Regenerating your data and linking of .dlls also get cleared and new solution for that Project is Created so here you also loss Your data
In Short, The Process of Clean Cleans the Whole Solution linking and data while Rebuild regenrates the new solution after cleaning the data and linkings.
We have a Windows 8 Modern / Metro app that we wish to deploy outside the store. I have read a bunch of materials on getting a side loading license to allow this. However, we need to go beyond just copying the app over and running some PowerShell commands, we also need to install a particular hardware driver and make some registry keys.
Can anyone recommend an installer creator that can perform all of these tasks?
Out of curiosity, is it possible to distribute through the Windows Store and have it do more than just copy the app down, i.e. execute an installations script?
By design, the installation process for a Store app, whether downloaded from the Store or side-loaded, is not customizable. For Store downloads, this is done to guarantee that the app install won't create anything that cannot be reversed during an uninstall, e.g. create registry entries, copy files, and otherwise do things that can permanently alter the system.
For side-loading, although you cannot alter the specific package deployment process itself, you can use the Powershell deployment as just one step in an overall install process. You should be able to build such an installer with any number of existing Desktop application installer tools, which give you control over all steps in your install process including registry, drivers, running scripts, etc. So you'd just have the app package and PS scripts as part of the installer .msi or .exe, and executing the PS script is done from the installer.
(By the way, the Store/PS app install processes use the same API in Windows.Management.Deployment.PackageManager to do the work. This API can be used only from a full-trust process like the Store (a piece of system code) or Powershell running in an admin console, but is there so desktop apps can implement alternate install procedures directly.)
I am writing a portable application that connects to both a firebird database and a mysql database. I am writing the application in Delphi 2010, and using dbExpress components to connect to both databases. SQLconnection component uses dbxmys.dll and libmysql.dll for the mysql database, and dbxfb.dll and fbclient.dll for the firebird database.
On my development computer I had to move the dll files into /windows/system/. I think this is because of the system paths, in order to find the correct files and connect. I tried this on another client machine, and the software could not connect because the dll files were not found. Because this is a portable application I do not want to include a sub directory of the application directory to include the dll files, however I do not think the a client machine can run the applicaiton without having mySQL and Firebird installed and the pathing set correctly.
Is there a better way to do this? I have concidered making a sub directory and forcing my application to look there, (since firebird and mySQL can be installed anywhere) if they were included I would know for sure were they were at on any computer my app is launched from. But I don't really want to take this approach.
What are my options as far as direct db connection, or solving the dll requirement problem, I am not an experienced software developer. Thanks in advance.
Update:
The DLLs are now in the same directory with the exe, and the application launches fine. I Still do not want to use any dlls. I have found a few components that do not require dlls, but they also require payment, finding another free option would be ideal.
What you can do is to store the .dll within the main .exe as zipped resources, then expand them in a local folder (local "Application data" for instance), and execute the library from there. Therefore, you do not need to put files in the system path (probably with administrator rights), nor change the path itself.
As a result, you do not need to copy the .dll with the .exe, and if the .dll are already available, your application will use them. The .exe folder won't be "polluted" by the library files, and your software could be still self-installing: if you copy the .exe in another computer, you still have the .dll within it, ready to be installed in an hidden local folder.
This is for instance how our SynProject tool use Hunspell libraries for spell checking. See this SO answer.
What is the best practice for creating an installer for a winform application.
The application is supposed to install the following without connecting to internet.
.Net Framework 3.5sp1
MySQL Server
My SQL Connector
Restore Mysql db
Update Config file with the MySQL uname/pwd.
I have all the msi files for installing the above mentioned items. But am wondering about the best practice to create the installer.
Thanks in advance,
Hi I came up with a similar situation. Firstly you should have .NET framework offline installer which can be downloaded from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=992cffcb-f8ce-41d9-8bd6-31f3e216285c. I assume you are using visual studio installer. There are couple of choices but I prefer to copy the offline .NET installer to the setup projects output directory and from requirements on target machine tab I set the install URL property of .NET framework the exact name of offline setup file. As described in the figure.
So the installer does not try to connect to a remote computer to download .NET framework and install it however I think it is more appropriate that it connects to a Microsoft server and installs it. Anyways the next step is to configure the MySQL server. MySQL is really generous for me since they support a fully documented noinstall files. You can find the document here: http://dev.mysql.com/doc/refman/5.5/en/windows-install-archive.html
Using a noinstall zip archive you can copy the dbengine core files to any folder on the clint machine. And change the configuration parameters of MySQL. You can name the MySQL service anything you want. Start the the service and create tables. You can do all of this stuff from custom actions tab of the setup project choosing the appropriate script files or you can write code for it. The beautiful thing is that your customer does not need to know that he/she is installing a database engine on the target machine. I hope this helps. Thanks.