Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing .plist file causes the Application not showing #787

Closed
felixf4xu opened this issue Nov 9, 2024 · 6 comments
Closed

Missing .plist file causes the Application not showing #787

felixf4xu opened this issue Nov 9, 2024 · 6 comments

Comments

@felixf4xu
Copy link

Hi,

I managed to compile the project and generate UICatalog.exe, but when I double click it to run, no GUI is displayed, only a console window with this message:

error org.compnerd.swift-win32 : [SwiftWin32] InitCommonControlsEx: Win32 Error 0 - The operation completed successfully.

I tried to debug step-by-step using vscode, this is the code stopped at last:

    _ = MsgWaitForMultipleObjects(0, nil, false,
                                  DWORD(exactly: time?.timeIntervalSinceNow ?? -1)
                                      ?? INFINITE,
                                  QS_ALLINPUT | DWORD(QS_KEY) | QS_MOUSE | DWORD(QS_RAWINPUT))

I mean I can set a breakpoint at MsgWaitForMultipleObjects and the breakpoint stops, if I continue to run, it runs, but nothing happens from there.

Win11, 23H2, 22631.4317, Visual Studio 2022 installed
swift 6.0.2
main branch of this repo.

@felixf4xu
Copy link
Author

swift 6.0.2

oh, I guess I'm still compiling using swift 5.9 mode, because I set // swift-tools-version:5.9. It will not compile if I set it to 6.0

@felixf4xu
Copy link
Author

After I read the README again, I fount out that I need to run:

mt -nologo -manifest Examples\UICatalog\UICatalog.exe.manifest -outputresource:.build\x86_64-unknown-windows-msvc\debug\UICatalog.exe
copy Examples\UICatalog\Info.plist .build\x86_64-unknown-windows-msvc\debug\
.build\x86_64-unknown-windows-msvc\debug\UICatalog.exe

Now it worked.

@felixf4xu
Copy link
Author

I found that the menifest tool only makes the GUI display nicer (I tested by purposely skip the mt step), it's actually the .plist file that prevent the exe to show up.

@felixf4xu felixf4xu reopened this Nov 9, 2024
@felixf4xu felixf4xu changed the title Application can run but nothing is showing Missing .plist file causes the Application not showing Nov 9, 2024
@compnerd
Copy link
Owner

Yes, the plist is required, that is not a bug but expected behaviour. There is no way to know the default type names and it needs to be provided by the developer.

@felixf4xu
Copy link
Author

In that case, Info.plist should be Required, the document like followings might not be accurate:

| Info.plist | (Optional) The information property list file is a structured file that contains configuration information for the application. |

| Info.plist | (Recommended) The file contains confituration information for the application. |

@compnerd
Copy link
Owner

That is accurate. It is not absolutely required. If you look at the initialisation codepath, you will find that we use the application name which is a parameter, and the principal class name, which if not specified via Info.plist is defaulted. The Info.plist is required because the application name doesn't match that default for the demo application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants