Deploy files in the localState folder during installation of a store app - deployment

I am building an app for windows store and I need some default and example data to be in the localstate folder (Windows.Storage.ApplicationData.current.localFolder) when the app run the first time.
The folder and files structure is a bit complex and I tryed to copy the files at the start of the application, but I can't manage that way.
Is it possible to have files being copied automatically from the installation folder to the localstate folder during the store app installation?

Unfortunately, customization of the app install process isn't currently supported. You have to do this as part of your first run processing.
One possibility is that you include the data in your package as a .ZIP or other compressed file and use an appropriate library to expand that file into a folder structure on startup. That could simplify your logic considerably. (I don't have a library to recommend; it's just an idea.)

Related

How logging to be done into a file in a specific folder

Some macOS apps write their logs into a folder like /Library/Logs or ~/Library/Logs? How this can be achieved?
I tried by creating a folder in ~/Library/Logs using FileManager.createDirectory. But I think creating a file and write every time on it using file manager functions will make the app more complex.

VS Code don't load the user-data

My problem is that the portable version of visual studio code don't load my settings I had copied from the folder %APPDATA%/code/user.
I loaded the .zip data and extracted the folder. I added a data folder into the extracted folder of VS Code. It's in Visual Studio Code\data. In there i copied the folder "user" from %APPDATA%/code/ and renamed the user folder into "user-data". Then I started code and the usersettings are not loaded.
The command .\code.exe --user-directory .\data\user-data won't work.
Is this a bug or did I do something wrong?
In portable mode, the --user-directory command linte option is ignored.
From the documentation:
--user-data-dir <dir>
Specifies the directory that user data is kept in, useful when running as root. Has no effect in Portable Mode.
Instead, use the default location of user data for a portable install and copy your user data to that directory (from a previous comment it seems like you've already done so successfuly).
For anyone wishing to use a different user data directory when in portable mode, symlink-ing the user data folder should be a viable option if on a linux-like platform.
(Trivia: this was at first reported as bug, after which the documentation was updated, rather making it a feature.)
You can simply create a folder called data in the root folder with
VS Code.
After the startup, the files with standard settings will be
created in the data folder.
Then you can just copy the settings from the folder %AppData%\Code\User to the folder data\user-data\User.
To migrate already installed extensions, copy the contents of the %HomePath%\.vscode\extensions folder to the data\extensions folder.

Packaging SF service into a single file

I am working through how to automate the build and deploy of my Service Fabric app. Currently I'm working on the package step and while it is creating files within the pkg subfolder it is always creating a folder hierarchy of files, not a true package in a single file. I would swear I've seem a .SFPKG file (or something similarly named) that has everything in one file (a zip maybe?). Is there some way to to create such a file with msbuild?
Here's the command line I'm using currently:
msbuild myservice.sfproj "/p:Configuration=Dev;Platform=AnyCPU" /t:Package /consoleloggerparameters:verbosity=minimal /maxcpucount
I'm concerned about not having a single file because it seems inefficient in sending a new package up to my clusters, and it's harder for me to manage a bunch of files on a build automation server.
I believe you read about the .sfpkg at
https://azure.microsoft.com/documentation/articles/service-fabric-get-started-with-a-local-cluster
Note that internally we do not yet support provisioning a .sfpkg file. This is a feature that will be coming in soon (date TBD). Instead, we upload each file in the application package.
Update (SF 6.1 - April 2018)
Since 6.1 it is possible to create a ZIP file (*.sfpkg) and upload it to an external store. Service Fabric executes a GET operation to download the sfpkg application package. For more infos see https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-package-apps#create-an-sfpkg
NOTE: This only works with external provisioning, the Azure image store still doesn't support sfpkg files.

Can Google Package App use external directories during packing?

I am writing a number of Google Packaged Apps which run independently, but share lots of code. For example, they all use "library.js". I would like to have only one copy of library.js so any changes to it will be used by all newly packed apps.
To package my apps, it seems they all must have a copy of library.js in their own directory structure, whereas it would be nice to have a single master copy in some other directory that is accessible to all. I currently do a manual check to make sure all files are up-to-date before packing, and I am writing some code to do the check automatically, but it seems like a work-around.
Can a Google Packaged App use JS code in external library directories, or must all code be under the root directory of the app (i.e., requiring copying from external directory) when packing?
Have you tried providing a URL i.e. host the javscript file in .js format to an accessible location to your apps and then provide the .js file URL in all your apps code. The very next time you want to change, all you have to do is to update that .js file.

Deploy Click once as a single file?

I am looking to use click once to deploy an application for internal use, When publishing to the network share it creates several files and folders. (manifest, ApplicationFiles etc)
Is there a way to bundle this up as a single file, I do not fancy the idea of allowing other users access to the application Files folder that is created, I would rather just give them the exe and have it take care of everything else.
Does anyone have experience with this, or am I stuck with the application Folder, Application Manifest, and setup file all being in the same directory for installation.
There is not a way to package the whole application folder and files into one file, like an MSI with ClickOnce.
You could code something on your own to have a shell app that use ClickOnce and its only file would be your app compressed. The shell would download that compressed file to the client's machine and would unzip etc.
You could also InstallShield Limited Edition that comes with VS 2012/2013 in the Other Projects, Setup and Deployment but that does give you the ClickOnce easy of deployment features. You could use the InstallShield setup to be your compress file in your shell clickonce app and then just use Process.Start to launch the InstallShield setup. It should work.