r57zone / Harry-Potter-Settings

Application for setup of Harry Potter 1, 2, 3 PC / Приложение для настройки Гарри Поттера 1, 2, 3 ПК
Other
52 stars 3 forks source link

HP3: SE and NL installations aren't detected #7

Closed Kaube closed 2 years ago

Kaube commented 2 years ago

Swedish and Dutch installations for HP3 aren't detected by the app. (Such installations for the HP1 and HP2 are detected however). As far as I've understood the code, the following lines with the corresponding folder names in each language are likely what needs to be added in file "Unit1.pas" after line 119:

  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter(TM) och Fången från Azkaban') then // Swedish
    HP3DocPath:='Harry Potter(TM) och Fången från Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter(TM) en de Gevangene van Azkaban') then // Dutch
    HP3DocPath:='Harry Potter(TM) en de Gevangene van Azkaban';

(For consistency, line 114 and 116 should note the language, i.e. English and Russian)

P.S. Thank you for making a very neat program!

r57zone commented 2 years ago

Hi, I'll try to add them soon

r57zone commented 2 years ago

I updated the code and added a new release, could you check if everything works correctly? https://github.com/r57zone/Harry-Potter-Settings/releases

Kaube commented 2 years ago

Thank you for updating! Unfortunately HP3 still does not appear for Swedish or Dutch installs. If you know that the Italian version appears, perhaps – for some reason – "(TM)" has to be written as "™" instead (UPDATE: That is most likely the case, see bottom). Another idea I have is about the directories. For reference, this is the directory to (HP3MainConfig =) hppoa.int* for each language as I install on Windows 11:

C:\Program Files (x86)\EA GAMES\Harry Potter(TM) och Fången från Azkaban\system\hppoa.int
C:\Program Files (x86)\EA GAMES\Harry Potter(TM) en de Gevangene van Azkaban\system\hppoa.int
C:\Program Files (x86)\EA GAMES\Harry Potter and the Prisoner of Azkaban(TM)\system\hppoa.int

Does this bit of code from line 124 in "Unit1.pas" result in the above directory? FileExists(DocumentsPath + '\' + HP3DocPath + '\' + HP3MainConfig)

Since I can see that HP3 from an English install appear, the code above should logically be working for the other two. Note that the directory for English HP3 also has a "(TM)" in it, while your program defines the directory to be "Harry Potter and the Prisoner of Azkaban", but yet it works when your code retrieves the int-file.

*When installing on Windows 11, HP1, HP2 and HP3 have .int instead of .ini-files. HP1 and HP2 appear nonetheless, so this should not be part of why HP3 is not appearing.

UPDATE: It's most likely that you only need to swap "(TM)" to "™" in the Swedish and Dutch entries. I just installed the Italian version, and I can verify that it appears. Its directory upon install is ".../Harry Potter(TM) e il prigioniero di Azkaban/...", so I feel quite sure about the swap. The whole code block should look like below in that case. I added also German and French directories as they were also available. I'll verify again for each version whether they appear, but I am fairly sure they will this time around. If not, let's just wind back to the earlier version 1.0.8 instead.

  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter and the Prisoner of Azkaban') then
    HP3DocPath:='Harry Potter and the Prisoner of Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Гарри Поттер и узник Азкабана') then // Russian
    HP3DocPath:='Гарри Поттер и узник Азкабана';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter™ e il prigioniero di Azkaban') then // Italian
    HP3DocPath:='Harry Potter™ e il prigioniero di Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter™ och Fången från Azkaban') then // Swedish
    HP3DocPath:='Harry Potter™ och Fången från Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter™ en de Gevangene van Azkaban') then // Dutch
    HP3DocPath:='Harry Potter™ en de Gevangene van Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter et le prisonnier d'Azkaban™') then // French
    HP3DocPath:='Harry Potter et le prisonnier d'Azkaban™';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter und der Gefangene von Askaban™') then // German
    HP3DocPath:='Harry Potter und der Gefangene von Askaban™';
r57zone commented 2 years ago

Fixed, could you check?

r57zone commented 2 years ago

https://github.com/r57zone/Harry-Potter-Settings/releases

Kaube commented 2 years ago

Thank you, I've checked all game versions now. In short, I realized a mistake I made and have provided the corrections below. I was stubbornly focused on the program files path and not the save data path (where the actual hppoa.ini – and not hppao.int – is located). Out of sheer coincidence, the swap from (TM) to ™ happened to correspond to the correct naming for the Dutch version, so it now appears just like English and Italian. The corrections below (removing TM/™ altogether) will make Swedish, French and German to also appear. I also took the time to install 8 more languages and find the correct save data path for them. I will check and verify again after update.

 if DirectoryExists(DocumentsPath + '\' + 'Harry Potter and the Prisoner of Azkaban') then
    HP3DocPath:='Harry Potter and the Prisoner of Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Гарри Поттер и узник Азкабана') then // Russian
    HP3DocPath:='Гарри Поттер и узник Азкабана';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter™ e il prigioniero di Azkaban') then // Italian
    HP3DocPath:='Harry Potter™ e il prigioniero di Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter och Fången från Azkaban') then // Swedish
    HP3DocPath:='Harry Potter och Fången från Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter™ en de Gevangene van Azkaban') then // Dutch
    HP3DocPath:='Harry Potter™ en de Gevangene van Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter et le prisonnier d''Azkaban') then // French
    HP3DocPath:='Harry Potter et le prisonnier d''Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter und der Gefangene von Askaban') then // German
    HP3DocPath:='Harry Potter und der Gefangene von Askaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter a vězeň z Azkabanu') then // Czech
    HP3DocPath:='Harry Potter a vězeň z Azkabanu';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter i więzień Azkabanu') then // Polish
    HP3DocPath:='Harry Potter i więzień Azkabanu';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter og fangen fra Azkaban') then // Danish
    HP3DocPath:='Harry Potter og fangen fra Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter og Fangen fra Azkaban') then // Norwegian
    HP3DocPath:='Harry Potter og Fangen fra Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter y el prisionero de Azkaban') then // Spanish
    HP3DocPath:='Harry Potter y el prisionero de Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter(tm) e o Prisioneiro de Azkaban') then // Portuguese (Brazil)
    HP3DocPath:='Harry Potter(tm) e o Prisioneiro de Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'Harry Potter e o Prisioneiro de Azkaban') then // Portuguese (Portugal)
    HP3DocPath:='Harry Potter e o Prisioneiro de Azkaban';
  if DirectoryExists(DocumentsPath + '\' + 'ハリー・ポッターとアズカバンの囚人') then // Japanese
    HP3DocPath:='ハリー・ポッターとアズカバンの囚人';
r57zone commented 2 years ago

Updated https://github.com/r57zone/Harry-Potter-Settings/releases/

Kaube commented 2 years ago

Checked and all of them works perfectly! Thank you for updating along with me, and again for making such a neat program!

r57zone commented 2 years ago

It's very cool that still play this amazing game and it unites people

Kaube commented 2 years ago

I agree! I love playing HP1, HP2 and HP3 and am sure many more do too.

P.S: I found some more directories for Thai, Chinese (Simplified) and Chinese (Traditional)

 if DirectoryExists(DocumentsPath + 'แฮร์รี่ พอตเตอร์กับนักโทษแห่งอัซคาบัน') then // Thai
   HP3DocPath:='แฮร์รี่ พอตเตอร์กับนักโทษแห่งอัซคาบัน';
 if DirectoryExists(DocumentsPath + '哈利·波特和阿兹卡班的囚徒') then // Chinese (Simplified)
   HP3DocPath:='哈利·波特和阿兹卡班的囚徒';
 if DirectoryExists(DocumentsPath + '哈利波特-阿茲卡班的囚犯') then // Chinese (Traditional)
   HP3DocPath:='哈利波特-阿茲卡班的囚犯';
Kaube commented 2 years ago

The three new languages does not appear after your recent update. The "else if" are broken between two lines and it's missing "+ '\' +" (my mistake for not including it from the beginning) for Thai, Chinese (Simplified), Chinese (Traditional):

...
  else if DirectoryExists(DocumentsPath + '\' + 'Harry Potter(tm) e o Prisioneiro de Azkaban') then // Portuguese (Brazil)
    HP3DocPath:='Harry Potter(tm) e o Prisioneiro de Azkaban'
  else if DirectoryExists(DocumentsPath + '\' + 'Harry Potter e o Prisioneiro de Azkaban') then // Portuguese (Portugal)
    HP3DocPath:='Harry Potter e o Prisioneiro de Azkaban'
  else if DirectoryExists(DocumentsPath + '\' + 'ハリー・ポッターとアズカバンの囚人') then // Japanese
    HP3DocPath:='ハリー・ポッターとアズカバンの囚人' else
 if DirectoryExists(DocumentsPath + 'แฮร์รี่ พอตเตอร์กับนักโทษแห่งอัซคาบัน') then // Thai
   HP3DocPath:='แฮร์รี่ พอตเตอร์กับนักโทษแห่งอัซคาบัน' else
 if DirectoryExists(DocumentsPath + '哈利·波特和阿兹卡班的囚徒') then // Chinese (Simplified)
   HP3DocPath:='哈利·波特和阿兹卡班的囚徒' else
 if DirectoryExists(DocumentsPath + '哈利波特-阿茲卡班的囚犯') then // Chinese (Traditional)
   HP3DocPath:='哈利波特-阿茲卡班的囚犯';

Instead I assume the code should be like this:

...
  else if DirectoryExists(DocumentsPath + '\' + 'Harry Potter(tm) e o Prisioneiro de Azkaban') then // Portuguese (Brazil)
    HP3DocPath:='Harry Potter(tm) e o Prisioneiro de Azkaban'
  else if DirectoryExists(DocumentsPath + '\' + 'Harry Potter e o Prisioneiro de Azkaban') then // Portuguese (Portugal)
    HP3DocPath:='Harry Potter e o Prisioneiro de Azkaban'
  else if DirectoryExists(DocumentsPath + '\' + 'ハリー・ポッターとアズカバンの囚人') then // Japanese
    HP3DocPath:='ハリー・ポッターとアズカバンの囚人'
  else if DirectoryExists(DocumentsPath + '\' + 'แฮร์รี่ พอตเตอร์กับนักโทษแห่งอัซคาบัน') then // Thai
   HP3DocPath:='แฮร์รี่ พอตเตอร์กับนักโทษแห่งอัซคาบัน'
  else if DirectoryExists(DocumentsPath + '\' + '哈利·波特和阿兹卡班的囚徒') then // Chinese (Simplified)
   HP3DocPath:='哈利·波特和阿兹卡班的囚徒'
  else if DirectoryExists(DocumentsPath + '\' + '哈利波特-阿茲卡班的囚犯') then // Chinese (Traditional)
   HP3DocPath:='哈利波特-阿茲卡班的囚犯';
r57zone commented 2 years ago

Updated, thanks

Kaube commented 2 years ago

Now, all versions are working! Thank you!

There are actually only three languages left as far as I know (Finnish, Hungarian, Bulgarian), but I haven't been able to try them.