Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by PavanJ · May 30, 2019 at 04:26 PM · universalwindows store appcommand-linecertificatecommand line

Building UWP/WSA from Command Line with Non-Test Certificate

I'm having an issue with building my Unity project through the command line with a certificate I got from Sectigo Limited with Code Signing. The reason why I went with getting a Sectigo Limited certificate instead of getting certified through the Windows Store is because we plan on the users downloading the app directly and sideloading it and we don't want to them to set their Windows to be in Developer Mode to install it, and we don't want to distrbute through the Windows Store. So when I set the certificate I got from Sectigo Limited I set it to be the certificate to be used in Unity in the Publisher Settings. I entered the password then used the following command to build the project.

 Unity.exe -quit -batchmode -silent-crashes -serial %UNITY_SERIAL% -username %UNITY_EMAIL% -password "%UNITY_PASSWORD%" -projectPath "sensei-v2" -logFile "%BUILD_BINARIESDIRECTORY%\build.log" -buildTarget WindowsStoreApps -executeMethod BuildSensei.BuildWindowsUWP -outputDirectory %BUILD_BINARIESDIRECTORY%

BuildSensei.BuildWindowsUWP is this function:

 PlayerSettings.SplashScreen.showUnityLogo = false;

 string[] scenes = { "Assets/MyProject/Scenes/Login.unity", "Assets/MyProject/Scenes/Main.unity" };

 string outputDirectory = "C:/Users/PavanJakhu/source/repos/myproject/Builds/UWP/MyProject-2.3.1.0";
 if (Directory.Exists(outputDirectory))
 {
     Directory.Delete(outputDirectory, true);
 }
 if (!Directory.Exists(outputDirectory))
 {
     Directory.CreateDirectory(outputDirectory);
 }

 BuildPlayerOptions options = new BuildPlayerOptions()
 {
     scenes = scenes,
     locationPathName = outputDirectory,
     target = BuildTarget.WSAPlayer,
     targetGroup = BuildTargetGroup.WSA,
     options = BuildOptions.None
 };
 var result = BuildPipeline.BuildPlayer(options);

 Debug.Log("Build result: " + result.summary.result + "\nTotal time: " + result.summary.totalTime + "\nPlatform: " + result.summary.platform);

I then try to build the Visual Studio solution through MSBuild using this command:

 "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" "C:/Users/PavanJakhu/source/repos/myproject/Builds/UWP/MyProject-2.3.1.0\MyProject\MyProject.sln" /nologo /nr:false /p:AppxBundlePlatforms="x64" /p:AppxPackageDir="C:/Users/PavanJakhu/source/repos/myproject/Builds/UWP/MyProject-2.3.1.0\MyProject\AppxPackages\\" /p:UapAppxPackageBuildMode=SideloadOnly /p:AppxBundle=Never /p:platform="x64" /p:configuration="Master" /p:VisualStudioVersion="16.0"

I get the following two errors.

 error APPX0105: Cannot import the key file 'Sensei-Code-Signing-Cert.pfx'. The key file may be password protected. To correct this, try to import the certificate manually into the current user's personal certificate store.
 error APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478.

If I open the solution and check the certificate and click "Choose Certificate" I see this dialog. Choose Certificate dialog Which seems incorrect since all the values are just "(none)." If I click "Select a Certificate," a native Windows dialog appears with the certificates in my Personal Store and I select the certificate I got from Sectigo Limited then build using the above command. It builds the AppX file and I can install it on computers without being in Developer Mode.

I have tried installing and reinstalling the certificate to my Personal and Trusted People stores. I also have tried using a test certificate generated in Unity then changing the Publisher attribute in the Identity tag in the App Manifest file for the exported Visual Studio project, then signing the generated AppX file with the Sectigo Limited certificate using SignTool.exe but then I get the following error

 error 0x8007000B: The app manifest publisher name (CN=Arfront Technologies Inc.) must match the subject name of the signing certificate (CN=Arfront Technologies Inc., O=Arfront Technologies Inc., STREET=4141 Yonge Street, STREET=Suite 402, L=Toronto, S=Ontario, PostalCode=M2P2A8, C=CA).

I then tried to create another self-signed certificate with the same subject name as the Sectigo Limited certificate but that gave the same error. So I'm stuck now and don't really know how else to do this. How would I go about creating an UWP app that is signed so a person sideloading it doesn't need to be in Developer Mode?

capture.jpg (27.2 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by alexanderlarsen · Jan 25, 2021 at 12:06 PM

@PavanJ Did you ever figure out a solution to this?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

109 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What minimum version of Unity supports command-line login on Mac OS,What minimum version of Unity do I need to be able to login via command-line? 0 Answers

Analytics not found when building from command line 1 Answer

Sharing a variable from command line with clients [C#][Unity] 0 Answers

Unity Standalone CommandLineArgs 0 Answers

Application.openURL crash in Universal App 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges