stride icon indicating copy to clipboard operation
stride copied to clipboard

[Gamestudio] Open asset file does not work

Open Mzoltan32 opened this issue 5 years ago • 9 comments
trafficstars

Release Type: Official Release

Version: Version number 3.1

Platform(s): Does the problem occur on Windows

Describe the bug does not poen asset file because no assigned programs exist

To Reproduce Steps to reproduce the behavior: 1.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem (use GitHub drag & drop)

Log and callstacks If any, please attach here any log or callstack (preferably in a .txt file using GitHub drag and drop)

Additional context Add any other context about the problem here.

Mzoltan32 avatar Feb 08 '20 16:02 Mzoltan32

Please provide the steps to reproduce and remove any paragraph that don't add any useful information.

Kryptos-FR avatar Feb 10 '20 07:02 Kryptos-FR

on a fresh installation open a map

then rightclick on an asset and select the open asset file option

On Mon, Feb 10, 2020 at 8:27 AM Nicolas Musset [email protected] wrote:

Please provide the steps to reproduce and remove any paragraph that don't add any useful information.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xenko3d/xenko/issues/597?email_source=notifications&email_token=ANQYZTGHIFN5O4V3SAOZZMLRCD6XFA5CNFSM4KR3SNL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELHPTZY#issuecomment-583989735, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQYZTCZ37MBY5E5PYARMZTRCD6XFANCNFSM4KR3SNLQ .

Mzoltan32 avatar Feb 10 '20 07:02 Mzoltan32

Have you read the documentation?

Kryptos-FR avatar Feb 10 '20 10:02 Kryptos-FR

i was just reading tutorials, it seems there are no basal editor programs bound to the asset file

On Mon, Feb 10, 2020 at 11:41 AM Nicolas Musset [email protected] wrote:

Have you read the documentation?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xenko3d/xenko/issues/597?email_source=notifications&email_token=ANQYZTEBTYQNVMQG7FGXXDDRCEVMLA5CNFSM4KR3SNL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELIA4SA#issuecomment-584060488, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQYZTHCFCO6ECRD3HSABKLRCEVMLANCNFSM4KR3SNLQ .

Mzoltan32 avatar Feb 10 '20 12:02 Mzoltan32

Cannot open an asset file which doesn't have a default program associated to it by the OS, we should probably have a modal show up instead of silently failing.

Eideren avatar Apr 27 '20 18:04 Eideren

Hello,

as a newcomer to this engine I wanted to try this issue but it seems that is already fixed as I get Windows 11 chooser to select which program to open.

Is it already fixed or could it happen on another OS version?

mattiascibien avatar Jan 09 '23 16:01 mattiascibien

I don't think it has been fixed so it may be OS dependant or file extension dependent, or user setting dependent (e.g. selecting auto-behavior for the dialog which shows up the first time) - would be interesting to see if we can get any feedback from the OS if file open resulted in an application being started.

manio143 avatar Jan 09 '23 19:01 manio143

Thanks for your answer. I will try to reproduce it during the day and try to see if I can provide a fix. Did not examine the code at the moment but I alway tought that a System.Diagnostics.Process.Start(file) would suffice.

mattiascibien avatar Jan 10 '23 07:01 mattiascibien

I have checked the code and found that the function to check is:

public async Task OpenFile(string filePath, bool tryEdit)
        {
            try
            {
                filePath = filePath.Replace('/', '\\');
                if (!File.Exists(filePath))
                {
                    await ServiceProvider.Get<IDialogService>().MessageBox(Tr._p("Message", "You need to save the file before you can open it."), MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }

                var process = new Process { StartInfo = new ProcessStartInfo(filePath) { UseShellExecute = true } };
                if (tryEdit)
                {
                    process.StartInfo.Verb = process.StartInfo.Verbs.FirstOrDefault(x => x.ToLowerInvariant() == "edit");
                }
                process.Start();
            }
            catch (Exception ex)
            {
                var message = $"{Tr._p("Message", "An error occurred while opening the file.")}{ex.FormatSummary(true)}";
                await ServiceProvider.Get<IDialogService>().MessageBox(message, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }

As far as I tried I do not see any problem in opening the file. @Mzoltan32 can you provide more info and a reproduction project to better check this?

mattiascibien avatar Jan 18 '23 12:01 mattiascibien