Red-Green-Code

Deliberate practice techniques for software developers

  • Home
  • About
  • Contact
  • Project 462
  • CP FAQ
  • Newsletter

Time Tortoise: Creating an App Package

By Duncan Smith May 25 0

Package

This is one in a series of articles about Time Tortoise, a Universal Windows Platform app for planning and tracking your work schedule. For more on the development of this app and the ideas behind it, see my Time Tortoise category page.

Last week I covered some of the requirements for self-hosting Time Tortoise. The next step is to package and deploy a self-hosted version of the app, without disrupting the ability to run it in debug mode in Visual Studio.

Create and Installing an App Package

In order to run a UWP app outside of Visual Studio, it must be installed from a package. For end users, this is a seamless process that happens from the Windows Store interface. For developers, the process requires a few more steps.

With the Time Tortoise solution open in Visual Studio, a package can be created as follows:

  • Right-click on the TimeTortoise.UWP (Universal Windows) project and select Store – Create App Packages.
  • On the Create Your Packages page, answer No to the question Do you want to build packages to upload to the Windows Store? That’s a job for later this year. For now, I just need a package that I can install locally.
  • On the Select and Configure Packages page, the default values are fine.
  • Click Create.

After a few minutes, all of the required files are created at the selected location. For my test, they were under a directory called TimeTortoise.UWP_1.0.0.0_Debug_Test.

At this point, we have all of the files required to install Time Tortoise locally, assuming the local machine is enabled for sideloading apps. To start the process, right-click on Add-AppDevPackage.ps1 and select Run with PowerShell.

One of the first things this PowerShell script does is install the certificate from the app package. To see this certificate, you can run certmgr.msc and navigate to Certificates – Current User -> Trusted People -> Certificates. UWP apps are designed to require a certificate as a security feature. In this case, we’re just using a temporary self-signed certificate for testing purposes.

Next, the script tries to install the app itself. This is where I encountered the following error message:

The current user has already installed an unpackaged version of this app. A packaged version cannot replace this.

The problem is that Windows does not allow two copies of the same app to be installed on the same machine. Fortunately, it’s easy to convince Windows that an app is different: simply change its package name. Since my goal is to run a dev version of Time Tortoise side by side with a self-hosted version, I used the following process:

  • Run Remove-AppxPackage [package_name] to remove the currently-installed version of Time Tortoise.
  • In Package.appxmanifest, set the package name to TimeTortoise.
  • Run the steps above to create and install the package. This is the self-host version.
  • In Package.appxmanifest, change the package name to TimeTortoise-dev.

Now when Time Tortoise is run from within Visual Studio, it will be seen as a different app called TimeTortoise-dev. This means its database will be isolated in a different folder under %UserProfile%\AppData\Local\Packages. As I mentioned last week, keeping development and self-host databases separate is a key requirement for self-hosting.

Running a self-host version of Time Tortoise with this process allows using the app for real scenarios, while improving the dev version using feedback from those scenarios. The self-host version can then be periodically updated with the latest improvements.

Categories: TT

Prev
Next

Stay in the Know

I'm trying out the latest learning techniques on software development concepts, and writing about what works best. Sound interesting? Subscribe to my free newsletter to keep up to date. Learn More
Unsubscribing is easy, and I'll keep your email address private.

Getting Started

Are you new here? Check out my review posts for a tour of the archives:

  • 2023 in Review: 50 LeetCode Tips
  • 2022 in Review: Content Bots
  • 2021 in Review: Thoughts on Solving Programming Puzzles
  • Lessons from the 2020 LeetCode Monthly Challenges
  • 2019 in Review
  • Competitive Programming Frequently Asked Questions: 2018 In Review
  • What I Learned Working On Time Tortoise in 2017
  • 2016 in Review
  • 2015 in Review
  • 2015 Summer Review

Archives

Recent Posts

  • Do Coding Bots Mean the End of Coding Interviews? December 31, 2024
  • Another Project for 2024 May 8, 2024
  • Dynamic Programming Wrap-Up May 1, 2024
  • LeetCode 91: Decode Ways April 24, 2024
  • LeetCode 70: Climbing Stairs April 17, 2024
  • LeetCode 221: Maximal Square April 10, 2024
  • Using Dynamic Programming for Maximum Product Subarray April 3, 2024
  • LeetCode 62: Unique Paths March 27, 2024
  • LeetCode 416: Partition Equal Subset Sum March 20, 2024
  • LeetCode 1143: Longest Common Subsequence March 13, 2024
Red-Green-Code
  • Home
  • About
  • Contact
  • Project 462
  • CP FAQ
  • Newsletter
Copyright © 2025 Duncan Smith