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

launch problem #2

Closed
meguminrn opened this issue Apr 27, 2017 · 59 comments
Closed

launch problem #2

meguminrn opened this issue Apr 27, 2017 · 59 comments

Comments

@meguminrn
Copy link

after pressing "launch" nothing happens, the ncsoft launcher does not seem to start, it does start without using bnsboost. Maybe its better to intergrate Log4net for better error handling.

@meguminrn
Copy link
Author

meguminrn commented Apr 27, 2017

Update:

If I'm right it, see this line

"
string DefaultLauncherPath = (string) Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\NCWest\NCLauncher", "BaseDir", "???") + "\ncLauncherR.exe";
"

If I understand this right, the your launcher tries to get a value from: HKEY_LOCAL_MACHINE\SOFTWARE\NCWest\NCLauncher

So I tried to find this folder in regedit and didn't find it, could this be the problem why the launcher does not want to start?

@ghost
Copy link

ghost commented Apr 27, 2017

BNSBoost uses the registry to find your NCLauncher location, so if you have a non-typical install (i.e., copied your game directories to/from another drive or something), it won't be able to find it.

To solve this, I'd propose having fallback methods like:

  • Attempting to launch via undocumented nc-launcher: URI: nc-launcher://?LauncherID=NCWest&CompanyID=12&GameID=BnS&LUpdateAddr=updater.nclauncher.ncsoft.com. Though I don't know if that would work without some logic to wait for the actual NCLauncherR.exe process to start. Also this would likely break under the same conditions that the current method breaks. Probably not a good solution, but worth mentioning.
  • Looking for NCLauncher in the default location %ProgramFiles(x86)%\NCWest\NCLauncher
  • Looking for NCLauncher in the current directory

I think that should handle most scenarios gracefully. I would submit a PR to do this but unfortunately I'm working something else right now.

Hope this helps.

Edit: Just reviewed the new commits with the UI. You should be able to manually select the path to NCLauncherR.exe? Some of what I said is still applicable though, for automatic detection of the location.

@Svarogue
Copy link

Svarogue commented Apr 27, 2017

I created ncwest and nclauncher directories in registry with my installpath data and problem was solved.
http://i.imgur.com/aDYSF9O.jpg
My default registry path HKEY_LOCAL_MACHINE\SOFTWARE\ Wow6432Node \NCWest

@Xyene
Copy link
Collaborator

Xyene commented Apr 27, 2017

Whew, I didn't expect so many people to be using the launcher from a non-default location... this is the fifth report of this issue 😁

@Svarogue is correct in that the easiest way to permanently fix this at the moment is to fix up your registry.

@meguminrn you should be able to specify the launch path in the UI, if you don't want to edit your registry. Better logging is definitely on the TODO, as is, of course, setting persistence. Could you also check out if running nc-launcher://?LauncherID=NCWest&CompanyID=12&GameID=BnS&LUpdateAddr=updater.nclauncher.ncsoft.com as @zeffy mentioned actually starts the launcher on your end? If so, that'd be a painless way to avoid all launch config issues.

Failing that, the rest of @zeffy's methods would likely eliminate most of these issues.

Xyene added a commit that referenced this issue Apr 27, 2017
@ghost
Copy link

ghost commented Apr 27, 2017

Regarding ed9e861 you may want to use Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) instead of expanding %ProgramFiles(x86)%, because I don't think that will work on 32 bit OS.

Also you could try checking Directory.GetCurrentDirectory() or Environment.CurrentDirectory (not sure if there is any real difference between the two) in addition to AppDomain.CurrentDomain.BaseDirectory, because they can differ under certain circumstances. Like if someone made a shortcut to BNSBoost and changed the "Start in" directory.

So could be something like this:

        private void Form_Load(object sender, EventArgs e)
        {
            string defaultLauncherPath = "unknown, please specify NCLauncherR.exe path";
            string[] searchDirs = {
                (string) Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\NCWest\\NCLauncher", "BaseDir", null),
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "NCWest\\NCLauncher"),
                AppDomain.CurrentDomain.BaseDirectory,
                Environment.CurrentDirectory
            };
            foreach(string dir in searchDirs)
            {
                string path = Path.Combine(dir, "NCLauncherR.exe");
                if (File.Exists(path))
                {
                    defaultLauncherPath = path;
                    break;
                }
            }

            LauncherPathTextBox.Text = defaultLauncherPath;
        }

@meguminrn
Copy link
Author

Hi Xyene,

Thanks to the new commit the launcher starts and works again, only problem is the dps meter, do I need to make another folder like this: https://imgur.com/a/xDygm and them put the xml inside it? xD.

because I don't get it and I cant see in your code where its trying to read the xml from this folder.

-megumin

@ghost
Copy link

ghost commented Apr 27, 2017

@meguminrn BNSBoost doesn't do anything directly with the .dat files, it just redirects the official launcher to check inside the unpatched folder (if the files exist) instead of the ones the game uses.

So you make a copy of the original (unmodified) .dat files in the unpatched folder, and then you are free to make any changes you want to the ones in the data folder. I hope that makes sense.

@meguminrn
Copy link
Author

meguminrn commented Apr 27, 2017

Ohhh. I understand it now thanks for explaining!

@meguminrn
Copy link
Author

update,

for some reason when I start bnsboost launch, the game starts but it goes into Repairing modes?

From what I understand is I can put my modified XML into the data folder and put the original XML file into unpatched folder which I created in Data folder, it should work then?

@ghost
Copy link

ghost commented Apr 27, 2017

Yes, that is correct. Although I haven't used the latest build yet, so I can't guarantee that it works as described. There was a bug that was present at the time I forked my steam_api build where the unpatched file path it looks for got built out of order (it was something like filename.ext\unpatched\C:\blah\original dir) and thus couldn't find the unpatched file. Don't know if that is related, though.

@Xyene
Copy link
Collaborator

Xyene commented Apr 27, 2017

@zeffy thanks, I'll add those additional search path sometime soon.

@meguminrn here's an image I posted in the bnsdojo thread that may confirm your understanding:

image

If you've done that and enabled the DPS meter with e.g. BNSBuddy and it still enters repairing mode, could you please upload your log.txt into https://gisthub.com or similar?

@meguminrn
Copy link
Author

hi, Can you share the topic link of bnsdojo?

@Xyene
Copy link
Collaborator

Xyene commented Apr 27, 2017

@meguminrn here you go.

Xyene added a commit that referenced this issue Apr 28, 2017
Xyene added a commit that referenced this issue Apr 28, 2017
@Xyene
Copy link
Collaborator

Xyene commented Apr 28, 2017

@meguminrn I believe I've fixed the issue causing your client to start repairing in a new release, could you check it out?

@DarkhShadow
Copy link

Only just updated to version 1.2 from 1.0.1 and clicking launch does not work for me, I tried with 1.1 but it still would not, I have the launcher in the default location C:\Program Files (x86)\NCWest\NCLauncher\NCLauncherR.exe and BnS installed to F:\BnS , log file is empty and I see no reason for it to not launch anymore.
Windows 10 64bit, can get other info if required

@spix18
Copy link

spix18 commented Apr 28, 2017

I have the same problem as DarkhShadow...version 1.2 is still not working , i have everything in defaut directory (launcher and BNS)

@Oberleutnant
Copy link

Same. Directories are correct but when I click on Launch, BNSBoost just closes and nothing happens.

So far, only 1.0.0 worked for me. I'm running it as administrator, of course.

image

@ghost
Copy link

ghost commented Apr 28, 2017

Same is happening here, I'm looking into this.

@ghost
Copy link

ghost commented Apr 28, 2017

I think I may have fixed this, but I'd like to wait for @Xyene to review my changes before a new release is pushed.

@ghost
Copy link

ghost commented Apr 28, 2017

@DarkhShadow @Kayo99 @Oberleutnant I just posted a new release, could you try it and let me know if it fixes the issue? https://github.com/Xyene/BNSBoost/releases

@Oberleutnant
Copy link

@zeffy After clicking Launch:
image

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.DllNotFoundException: Unable to load DLL 'Injector.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at BNSBoost.BNSBoostForm.NativeMethods.Launch(String lpLauncherBaseDir, String lpExtraClientFlags)
at BNSBoost.BNSBoostForm.<>c__DisplayClass4_0.b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at BNSBoost.BNSBoostForm.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at BNSBoost.BNSBoostForm.<LaunchButton_Click>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)

@ghost
Copy link

ghost commented Apr 28, 2017

Is Injector.dll in the same directory as BNSBoost.exe? That shouldn't be happening.

@Oberleutnant
Copy link

Of course it is.

@xKratosx
Copy link

Yes, I am getting the same thing.

@ghost
Copy link

ghost commented Apr 28, 2017

I think that exception was probably happening before, then (hence why the launcher never opened). Before the changes I made, any exceptions that happened when invoking Launch() were suppressed because it was ran in a separate thread.

@ghost
Copy link

ghost commented Apr 28, 2017

Out of curiosity, how are you running BNSBoost? Like directly from its own directory, with a shortcut, etc?

@ghost
Copy link

ghost commented Apr 28, 2017

@xKratosx @Oberleutnant I'm having issues getting the dlls to compile/work correctly in Release mode, so @Xyene will need to figure this out when he gets back. Sorry you guys are having trouble getting it working.

@xKratosx
Copy link

@zeffy no worries, thanks for trying!

@meguminrn
Copy link
Author

@xKratosx Maybe if you downlaod https://www.visualstudio.com/vs/whatsnew/ it will work like @zeffy explained.

@ghost
Copy link

ghost commented Apr 28, 2017

It may, but I don't think downloading a huge IDE like Visual Studio is a viable solution to this issue for most people! 😛

@xKratosx
Copy link

Yeah, roughly 10+GB, i'll have to pass and hope for a release mode zip.

@spix18
Copy link

spix18 commented Apr 28, 2017

Yea i have same errors as @xKratosx

@meguminrn
Copy link
Author

I try to compile it but meh doesn't work: http://prntscr.com/f1zqps

@zeffy You have the same problem or is it just me?

@ghost
Copy link

ghost commented Apr 28, 2017

@meguminrn Yes that happened to me, but I fixed that by changing the Windows SDK Version version to 10.0.14393.0 because I have VS 2017. I think it was on 8.1 because Xyene has VS 2015. I also had to change the linker additional dependencies to include Shlwapi.lib, but even then when I got it to compile under Release mode it still made NC Launcher crash when I pressed launch.

@Xyene
Copy link
Collaborator

Xyene commented Apr 28, 2017

Wait... not everybody has debug libs installed? /shy

Sorry about that @xKratosx @Kayo99 @Oberleutnant and anyone else affected by this issue, I've updated the release to include a release build that should not be linking any debug libs. Make sure to download the -RELEASE archive.

I've also set up AppVeyor to build artifacts on every commit.

@spix18
Copy link

spix18 commented Apr 28, 2017

@Xyene Working as intended the RELEASE archive v1.2.1 , Thank you

@xKratosx
Copy link

Works great! Thanks @Xyene

@DarkhShadow
Copy link

Working for me as well, but will there be an option to re-add the unattended option? (I use a sound pack)

@Gourxis
Copy link

Gourxis commented Apr 28, 2017

@Xyene still got the same problem here on -RELEASE version, when i click launch a debug message appears

@ghost
Copy link

ghost commented Apr 29, 2017

@DarkhShadow What does -UNATTENDED do for sound packs? Does it disable the popup messages when you open BnS or something?

Edit: Well, I'll be damned, it does! I'll add it back.

ghost pushed a commit that referenced this issue Apr 29, 2017
@ghost
Copy link

ghost commented Apr 29, 2017

I added it as a default flag, so no check box is needed to enable it. Perhaps at some point we could make it optional, but I'm not really sure why that would be necessary tbh.

@Xyene
Copy link
Collaborator

Xyene commented Apr 29, 2017

@Gourxis could you provide us with the text of the message? Additionally, it would be helpful if you could paste the contents of your log.txt to a paste service like https://gisthub.com. Thanks!

@DarkhShadow you can pick up a new binary with @zeffy's change from AppVeyor.

@Gourxis
Copy link

Gourxis commented Apr 29, 2017

@Xyene
`See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.IOException: You cannot create a file already correlated.

em System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
em System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)
em BNSBoost.BNSBoostForm.<LaunchButton_Click>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
em System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)`

@Xyene
Copy link
Collaborator

Xyene commented Apr 29, 2017

@Gourxis thanks, try this and see if it works.

@Gourxis
Copy link

Gourxis commented Apr 29, 2017

@Xyene Working now, thanks.

@iluvlamastaf
Copy link

Hey there. Everything seems to be working well except for the BnS client is still repairing my edited xml files (want to enable DPS meter). I did the unpatched folder (with the UNedited) and replaced all of the original ones with the edited ones. Any ideas?

@meguminrn
Copy link
Author

@iluvlamastaf

You need to create a folder called: unpatched like this: http://prntscr.com/f27h0s

You need to put the original config.dat and xml.dat in this folder, after you did this,
you will need to keep another config and xml in to the base folder which you enabled dps meter on. you can just copy the config.data file and put it on the base folder and another one into the unpatched folder

@Xyene
Copy link
Collaborator

Xyene commented Apr 29, 2017

@iluvlamastaf if you've followed @meguminrn's advice and it continues to not work, could you provide me with the log.txt generated in the same directory as BNSBoost.exe?

@Xyene Xyene closed this as completed Jun 5, 2017
Xyene pushed a commit that referenced this issue May 4, 2018
Xyene pushed a commit that referenced this issue May 4, 2018
Xyene pushed a commit that referenced this issue May 4, 2018
Xyene pushed a commit that referenced this issue May 4, 2018
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

9 participants