Scripts
Sunday, March 5, 2023
9:57 AM
While developing OneMore, I've found it useful to maintain a small set of scripts to automate common tasks and to create repeatable environments and configurations.
build.ps1
Its usage is described in detail here but its general purpose is to automate building the installer for different architectures. The OneMore solution is set to build x64 by default. This script temporarily modifies the solution to build x86, builds, and then resets the configuration back to x64.
- .\build.ps1 86 - builds just the x86 installer
- .\build.ps1 64 - builds just the x64 installer; the default if no arguments are provided
- .\build.ps1 -both - builds both the x86 and the x64 installers
- .\build.ps1 -fast - builds just the OneMore and OneMoreProtocolHandler projects, without the installer
- .\build.ps1 -prep - prepares your workstation to build using this script as described here
install-vsix.ps1
Installs the Visual Studio Installer Projects extensions. Currently set up for VS2022.
iq.ps1
This is the installation qualification script. It simply reads and reports the configuration from the System Registry and identifies any issues. Typical output of a correctly configured system looks like this:
PS C:\Github\OneMore> .\iq.ps1
|
setregistry.ps1
This is an easy way of configuring the COM registration paths in the Registry to point to your Visual Studio output folders rather than the installation path.
- You must first install OneMore as you normally would to create all the necessary Registry entries.
- Clone the OneMore repo to your local machine
- Run the .\Build.ps1 -Fast script to create the DLLs that setregistry needs to discover
- Run the script from the root folder of the repo
PS C:\Github\OneMore> .\setregistry.ps1
- Run this script to redirect the COM Registry settings
When you rebuild OneMore and run OneNote, it will run the add-in out of your local repo rather the installed location.
You can also reset the Registry configuration to point to the install path using the -Reset argument
PS C:\Github\OneMore> .\setregistry.ps1 -Reset
PS C:\Github\OneMore> .\setregistry.ps1
|
setversion.ps1
There are a number of places that need to be touched every time OneMore is versioned to be released. This script automates that task by updating each of them with a specified version string. The usage is
PS C:\Github\OneMore> .\setversion.ps1 5.8.1
Specify a complete semantic version of the form major.minor.patch
This script touches these files
- .\OneMore\Properties\AssemblyInfo.cs
- .\OneMoreCalendar\Properties\AssemblyInfo.cs
- .\OneMoreProtocolHandler\Properties\AssemblyInfo.cs
- .\OneMoreSetupActions\Properties\AssemblyInfo.cs
- .\OneMoreSetup\OneMoreSetup.vdproj
stop.ps1
In the event that OneMore or OneNote becomes unresponsive, or you think you've shutdown OneNote but the dllhost COM suggogate process remains, use this script to forcefully terminate these processes.
This script specifically targets only the OneMore COM suggogate process and the ONENOTE.exe process. No other processes will be affected.
update-sdk.ps1
Patches the OneMore.csproj file with your machine's path to the .NET Framework System.Runtime.WindowsRuntime assembly and the path and version of the Windows SDK Windows.winmd file. Read more about this on the developer's Getting Started page.
If no changes are required, you'll see something like this
PS C:\Github\OneMore> .\update-sdk.ps1
|
#omwiki #omdeveloper
© 2020 Steven M Cohn. All rights reserved.
Please consider a sponsorship or one-time donation to support ongoing development
Created with OneNote.