Recent Posts

Pages: [1] 2 3 ... 10
1
General Discussion / Re: Mod manager
« Last post by RedKetchup on Today at 05:49:58 PM »
RK:
Is there 'UninstallString'  item in 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 242920\'?
Is yes, what's it's value? Is it 'D:\Steam\SteamApps\common\Banished\something.exe'?

you will find a REG_SZ there named "InstallLocation" and the value inside this REG_SZ is the folder it has been installed : my value is "D:\Steam\steamapps\common\Banished"

then you add "\Bin\WinData\" to it and you've got the folder where are the mods.
2
General Discussion / Re: Mod manager
« Last post by JM on Today at 05:31:36 PM »
Tom:
That's what I'm doing, first of all the Steam folder and then looking in the registry.
On my 10 year old computer - Core 2 duo, 2GB of memory, WinXP 32bit -  it takes almost no time.

RK:
Is there 'UninstallString'  item in 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 242920\'?
Is yes, what's it's value? Is it 'D:\Steam\SteamApps\common\Banished\something.exe'?

3
General Discussion / Re: Mod manager
« Last post by RedKetchup on Today at 05:25:01 PM »
If  'C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe' exists and in WinData there are four pkm files, I'll take it.

my game is install :'D:\Steam\SteamApps\common\Banished\Application-steam-x64.exe'

how you will find it ?

did you checked the REG_SZ there : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 242920\
4
General Discussion / Re: Mod manager
« Last post by Tom Sawyer on Today at 04:46:15 PM »
Change: If  'C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe' exists and in WinData there are four pkm files, I'll take it.

That's what I was talking about. It works now for my installation and I guess for all other Steam users as well. Just copy ModMan where ever you like and run it. :)

The only thing I noticed is that your searching the registry seems to takes some time. Maybe to try Steam folder first and only if it doesn't exist to search in registry. But that's really a tiny thing.
5
General Discussion / Re: Mod manager
« Last post by JM on Today at 04:24:02 PM »
Originally I read and displayed only registry entries and I did not care about mod files, but the registry also contains a lot of entries of  mods I once tried and then deleted. This 0.0 version was not published.

Now I search for existing files in WinData and for each one I search for ModIndex and ModEnabled in the registry. If mod does not have these items in the registry because I just added it and did not play the game yet, I add the mod to the end of the list. That's why I need a WinData directory.

When path in ModMan.ini not found, because it is the first start, I look for the path to exe as follows:
I browse all the keys in 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall' and look for DisplayName REG_SZ 'Banished'. If found, I use the UninstallString value to get the path to the uninstall file. For me, it's 'D:\Games\Banished\unins000.exe'.
I have Application-x32.exe in the same directory **, so the mods are in 'D:\Games\Banished\WinData'. Then I look for 'data0.pkg', 'data1pkg', 'patch0.pkg' and 'patch1.pkg'. When I find all this ***, the path to the file is used as the starting directory when using the file dialog. If I do not find what I was looking for, the initial directory is the ModMan directory.

/** I do not know how it is in Steam installation. Is there a 'UninstallString' entry in the uninstall record in the registry? If so, is the target in the same directory as Applicationxxxx.exe and WinData? Is there anything at all in the registry that can be used to find path to WinData?

/*** Perhaps, at this point, I could recognize the path as valid and not force the user to confirm it.

Code: [Select]
function GetBanishedDirectory: string;
const
  UPath = 'Software\Microsoft\Windows\CurrentVersion\Uninstall';
var
  R: TRegistry;
  SL: TStringList;
  i: integer;
  S,WS: string;
begin
  Result := '';
  R := TRegistry.Create;
  try
    R.RootKey := HKEY_LOCAL_MACHINE;
    if not R.OpenKey(UPath,False) then Exit;
    SL := TStringList.Create;
    try
      R.GetKeyNames(SL);
      for i := 0 to SL.Count-1 do begin
        R.CloseKey;
        if R.OpenKey(UPath+'\'+SL[i],False) then begin
          try S := R.ReadString('DisplayName') except S := ''; end;
          if SameText(S,'Banished') then begin
            try S := R.ReadString('UninstallString') except S := ''; end;
            if S = '' then Continue;
            if Copy(S,1,1) = '"' then Delete(S,1,1);
            if Copy(S,Length(S),1) = '"' then Delete(S,Length(S),1);
            S := ExtractFilePath(S);
            WS := S+'WinData';
            if not DirectoryExists(WS) then Continue;
            WS := WS + '\';
            if not FileExists(WS+'data0.pkg') then Continue;
            if not FileExists(WS+'data1.pkg') then Continue;
            if not FileExists(WS+'patch0.pkg') then Continue;
            if not FileExists(WS+'patch1.pkg') then Continue;
            Result := S;
            Break;
          end;
        end;
      end;
    finally
      SL.Free;
    end;
  finally
    R.Free;
  end;
end;

================

Change:

If  'C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe' exists and in WinData there are four pkg files, I'll take it.

6
General Discussion / Re: Mod manager
« Last post by kid1293 on Today at 03:40:40 PM »
Just a small thought. Easy solution.
Why not put it in Banished directory and look only in current directory for Application (Steam or Vanilla)?
Are people so computer illiterate they can not follow a simple instruction?
7
General Discussion / Re: Mod manager
« Last post by Tom Sawyer on Today at 03:31:20 PM »
It can be started via Steam launcher or from file.. As I wrote in C:\Program Files (x86)\Steam\SteamApps\common\Banished\Application-steam-x64.exe
8
General Discussion / Re: Mod manager
« Last post by embx61 on Today at 01:41:42 PM »
Probably he needs the path to find the Banished registry entrees.

Long, long time that i used Delphi so bear with me if i screwed up somewhere :)
If the name of the executable is known it is easy to get the path of the application.

Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
   var AppDir: string;
begin
   AppDir := ExtractFileDir(Application.ExeName); <--- So Application.Application-steam-x64.exe
  // Do something with useful here with the path. for example Edit1.text := AppDir;
   ShowMessage(AppDir);  // <--- just show a message as test :)
   end;
end;

Of course this is useless pseudo code with a onclick event handler what is not needed by itself so JM has to do it all behind the scene at init stage as Mod Manager starts so the user not even know the path is taken and used.

Can always raise an exception if something goes wrong or the exe does not exist by putting the code above in an exception handler block.
9
General Discussion / Re: Mod manager
« Last post by JM on Today at 01:21:48 PM »
I do not need exe. Need WinData to be able to make list of existing mods. It's easier to find the exe using the standard windows open dialog.
I am searching Software\Microsoft\Windows\CurrentVersion\Uninstall for all installed programs, looking for DisplayName = Banished, then extract uninstall directory from UninstallString. Maybe Steam installation differs grom my installation.

I do not have access to a computer with a game installed from Steam.

Dropping an icon works?
Steam users use an exe or launcher to start the game?


10
General Discussion / Re: Mod manager
« Last post by Tom Sawyer on Today at 01:01:16 PM »
Sorry to say but the auto detection does not work in my Steam installation. May I ask why do you actually need the path of the game exe?
Pages: [1] 2 3 ... 10