Skip to content

Commit

Permalink
Merge pull request #1217 from RedBlackAka/master
Browse files Browse the repository at this point in the history
Add .ustx file association on Windows and MacOS
  • Loading branch information
stakira authored Jul 24, 2024
2 parents f8c8936 + 725cb59 commit 4e89df7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
12 changes: 12 additions & 0 deletions OpenUtau.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ Section -Post
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"

WriteRegStr HKCR ".ustx" "" "OpenUtauFile"
WriteRegStr HKCR "OpenUtauFile" "" "OpenUtau Sequence File"
WriteRegStr HKCR "OpenUtauFile\DefaultIcon" "" "$INSTDIR\OpenUtau.exe"
WriteRegStr HKCR "OpenUtauFile\shell\open\command" "" "\"$INSTDIR\OpenUtau.exe\" \"%1\""
SectionEnd


Expand All @@ -100,6 +105,13 @@ Section Uninstall

Delete "$SMPROGRAMS\OpenUtau\Uninstall.lnk"

DeleteRegKey HKCR ".ustx"
DeleteRegKey HKCR "OpenUtauFile\DefaultIcon"
DeleteRegKey HKCR "OpenUtauFile\shell\open\command"
DeleteRegKey HKCR "OpenUtauFile\shell\open"
DeleteRegKey HKCR "OpenUtauFile\shell"
DeleteRegKey HKCR "OpenUtauFile"

RMDir "$SMPROGRAMS\OpenUtau"
RMDir "$INSTDIR"

Expand Down
24 changes: 22 additions & 2 deletions OpenUtau/OpenUtau.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFramework>net6.0-windows</TargetFramework>
</PropertyGroup>
Expand Down Expand Up @@ -28,6 +28,26 @@
<CFBundleIconFile>OpenUtau.icns</CFBundleIconFile>
<NSPrincipalClass>NSApplication</NSPrincipalClass>
<NSHighResolutionCapable>true</NSHighResolutionCapable>
<CFBundleDocumentTypes>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>OpenUtau Sequence File</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>ustx</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>OpenUtau.icns</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.stakira.openutau.ustx</string>
</array>
</dict>
</array>
</CFBundleDocumentTypes>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
Expand Down Expand Up @@ -97,4 +117,4 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
</Project>

0 comments on commit 4e89df7

Please sign in to comment.