Migrating a Win32 app that uses the AppData folder to share files to Desktop Bridge - win-universal-app

I am migrating some Win32 apps to the Windows Store using Desktop Bridge. I have several apps that have been sharing files in %APPDATA%\Roaming\XYZCompany. I understand from the Microsoft docs that this will no longer work since each app will have its own isolated version of the AppData folder.
So what is the "right" way to share files between my own UWP / Desktop Bridge apps?
The best solution I've come up with so far is moving the shared files to the user's documents folder, but that seems ugly. In iOS and Android there are slick ways for apps from one developer to share files. Is there something like that for UWP apps that I just haven't found?

You can create a PublisherCacheFolder (see documentation) which can be used to share data among your UWP apps.
To be able to use this API, you need to declare the names of your folder in the package.appxmanifest file:
<Extensions>
<Extension Category="windows.publisherCacheFolders">
<PublisherCacheFolders>
<Folder Name="MyFolder" />
</PublisherCacheFolders>
</Extension>
</Extensions>
Now you can access this folder:
var folder = ApplicationData.Current.GetPublisherCacheFolder( "MyFolder" );
For more info look into this article on MSDN.

Related

Publishing a web application with an executable to MS Azure

Here is my situation, I have a web app that contains:
An .exe (which is a .net project along with assembly files and so on)
ZIPped xml files
Folders containing js&css files
Now when executing the .exe it parses the xml inside the ZIPs to create html files( the end result is a complete html that imports some of the js libraries and css files).
Considering that I have basic experience in MS Azure, I am looking for a way to have my application run on azure? My guess is that the ZIPped xmls could be stored most probably using blob storage along with the js and css files. What I am not sure of is how to get the executable running there(Possibly deploying the .exe with its corresponding resources,assemblies,dlls etc...) and have it execute from there.
If you really want to use a home grown build process (your exe) then you need to use cloud services (your own VM) where you can run this and expose your website over whatever ports you want. However it sounds like you are new to .Net, I'd suggest reading up on ASP.Net MVC Web Projects. That way you can leverage Visual Studio for building the website and deploy to a Azure Website, which is designed to host websites.

Setting Up Continuous Deployment of a WPF Desktop Application

For a project I am currently working on, I need to create a setup application for an existing desktop application. The setup application will be downloaded from a website, and will download required files to the correct locations. When the application is started, it will look for newer versions of these files, download them if any exist, then start the application.
I am using Visual Studio Online with TFVC, linked to Azure. I have a test application set up so that when I trigger a build, Release Management finds the build directory, and moves the files to Azure Blob Storage, but prepends a GUID to the file names being transferred. So what I have in my storage container is:
{Some GUID}/2390/Test.exe
{Some GUID}/2389/Test.exe
{Some GUID}/2387/Test.exe
...
What I want in my container is the latest version of Test.exe, so I can connect to the container, and determine whether I want to download or not.
I have put together a NullSoft installer that checks a website, and downloads files. I have also written a NullSoft "launcher" that will compare local file versions with versions on the website (using a version xml file on the website), and download if newer, then launch the application. What I need to figure out is how to get the newer files to the website after a build, with automation being one of the goals.
I am an intern, and new to deployment in general, and I don't even know if I'm going about this the right way.
Questions:
Does what I am doing make sense for what I am trying to accomplish?
We are trying to emulate ClickOnce functionality, but can't use ClickOnce due to the fact that the application dynamically loads a number of DLLs. Is there a way to configure ClickOnce to include non-referenced DLLs?
Is there a best practice for doing what I'm describing?
I appreciate any advice, links to references, or real-world examples.
You are mentioning ClickOnce, which you investigated but can't use. Have you already tried an alternative: Squirrel? With Squirrel you can specify which files should be part of the installation, allowing you to explicitly specify which files to include even if you load them dynamically.
Link: https://github.com/Squirrel/Squirrel.Windows
Squirrel is a full framework for creating an auto-update application and can work with Azure Blob Storage hosting (and also CDN if you need to scale up)

JavaFx 2 - Self Contained Applications and their preferences, database, etc

Let say i have a cross-platform runnable application
This application create then read/write some data and preference in external files
Bundle hierarchy is as follow:
ApplicationFolder/application.jar
ApplicationFolder/database.odb
ApplicationFolder/config.xml
Whether it's on a Mac, Windows or Linux, the application knows that everything is next to her (ie: /database.odb or /config.xml)
Now comes the Self Contained Application feature provided by JavaFx 2
The application is embedded in .exe on Windows, .app on Mac and don't know yet about Linux...
As a Mac user i've tested it on Mac and saw that database.odb and config.xml are now created at the user root path
I thus agree that i should think of a cross-platform mechanism to save/read my application preferences regarding the operating system
But i'm not quite sure of what to do and how to do it (can't find any googling help either..)
On windows, the .exe is installed in a folder, so i guess i can keep the same behavior
On Mac, the .app is a folder and i should keep everything inside (how to get the .app path ?!)
Isn't there a built-in mechanism in Java/JavaFx ?
Thanks a lot for any comment, advice, documentation or else that you could give me
Badisi
There are many ways to do this. I have listed some of them here in no particular order. The recommended approach depends on the type of data being stored.
Java provides a couple of mechanisms (e.g. the properties API and the preferences API) for maintaining application preferences.
If your application is sophisticated enough to benefit from an database, then you might want to use Java EE or Spring, both of which have their own configuration mechanisms.
For read-only configuration, you can bundle the relevant files inside your application jar.
To store customized application configuration files or client application wide databases in relative to the application jar, write the required files at runtime. See How do I get the directory that the currently executing jar file is in?.
For user specific configuration, use System.getProperty("user.home") to retrieve the user's home directory, then create a subdirectory for your preference storage (for example "{$user.dir}/.myapp") with hidden file attributes so that it doesn't show up on a standard file directory list.
If your app relies on internet connectivity, then you can store some of this information server side rather than the client and make use of it from the client using internet protocols. An advantage of this approach is that user configuration and data is automatically ported across client machines.

Configure the multimedia components to get published inside the website folder

Need to publish the JS and CSS files using multimedia components.
The multimedia components gets published outside the website folder similar to the Images in
“C:\tridion\temp\pub14\Includes\scripts”
Any Idea How to Configure the multimedia components to get published inside the website folder.
We are using IIS to deploy website
You can control this by editing cd_storage_conf.xml. In this file you can configure where binaries go for each publication. For example: you probably have something like this configured: <Item typeMapping="Binary" cached="false" storageId="myStorageId"/> and this myStorageId storage is defined inside the Storages element like:
<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory"
Id="myStorageId" defaultFilesystem="true" defaultStorage="true">
<Root Path="c:\temp\" />
</Storage>
If that is the case then you need to change the root path to point to the root of your WebApplication in IIS. More about how to configure the storage you have here (logon required).
You can overide the path of your multimedia binary using template code as long as you have structure group created for same path.
Ex if you want to publish particular binary to \css\images folder, you first have to create the structure group for same path(\css\images) and use the structure group id in the following code to publish the binary.
engine.AddBinary(Binary.Id, templateID, binaryStructureGroupID, Binary.BinaryContent.GetByteArray(), Binary.FileName);

How to get the isolated storage path for accessing the files and folders in windows phone7 application?

In windows mobile 6 applications, I use code like Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
to get the application path.
Likewise in windows phone7 application, how to get the isolated storage path and how to access the files and folders in my application?
Please give me a sample code for develop my application.
Just use IsolatedStorageFile.GetUserStoreForApplication() to get an object which can manipulate files and directories in Isolated Storage.
See this MSDN link which has plenty of example code.
have a look here: Retrieving file path from IsolatedStorage
isoStore.GetType.GetField("m_RootDir", Reflection.BindingFlags.NonPublic).GetValue(isoStore).ToString();
^ or Reflection.BindingFlags.Instance

Resources