Comments (7)
The New Instance dialog allows you to customise the name - and the placeholder text indicates the name it will use by default.
The problem is, this means we need to determine the name before the dialog is submitted. The instance.cfg location in the file is not defined so it could require scanning a large part of the file.
from prismlauncher.
For Prism Launcher exports specifically, is there any reason the instance.cfg
file wouldn't be in the root of the .zip
file, assuming the file was exported through Prism Launcher and not zipped manually? I'd imagine the subset of users who are manually zipping export files and changing the location of instance.cfg
is pretty small.
Alternatively, it could check a specific path in the .zip
(/instance.cfg
) for the configuration file, and if it doesn't find it, then default to the name of the .zip
file?
from prismlauncher.
Because we need to extract that file to read it and get that name, and the extraction happens at the end.
The reason we do not do the extraction first is that the user may not want to finish adding that instance when selecting the zip file.
This issue is similar to: #876 (comment) but instead of displaying the name of the instance that one requests displaying the icon that is inside the zip folder.
from prismlauncher.
For Prism Launcher exports specifically, is there any reason the
instance.cfg
file wouldn't be in the root of the.zip
file, assuming the file was exported through Prism Launcher and not zipped manually? I'd imagine the subset of users who are manually zipping export files and changing the location ofinstance.cfg
is pretty small.Alternatively, it could check a specific path in the
.zip
(/instance.cfg
) for the configuration file, and if it doesn't find it, then default to the name of the.zip
file?
Well, moving the instance.cfg wouldn't be valid - I'm not saying we should account for that. I don't know exactly how zip files are structured, but are files in the root guaranteed to be near the start of the file? I doubt it. Also, checking for a specific path involves iterating over every entry I'm pretty sure (although you can probably skip a lot of data on local files).
from prismlauncher.
Ok, so if extracting before the user confirms installation isn't a good idea, what if it changed the instance name during installation instead? If the user specifies a name, use that name and ignore the instance.cfg
file, but if the name would be the same as the .zip
file's name, then read the instance.cfg
file and use the name
key from that file? It'd look kinda weird in the UI but it'd work. Could disable name previews for .zip
files maybe?
from prismlauncher.
Because we need to extract that file to read it and get that name, and the extraction happens at the end. The reason we do not do the extraction first is that the user may not want to finish adding that instance when selecting the zip file. This issue is similar to: #876 (comment) but instead of displaying the name of the instance that one requests displaying the icon that is inside the zip folder.
But you don't need to extract the whole archive no? You could take only that specific file.
I'm not an expert but I think according to this - One, this is possible. But that's "unzip" idk if you could use it with C++ (well technically there is a source code of this package with win32/linux etc. code)
Here is another one with 7z Another one
The file itself is something like ~1-2KB, surely it can be done before instance setting window? Moreover if user exports as Prism archive, instance.cfg
would be in exact same place unless they move/delete it, but in that case step with checking instance.cfg
can be skipped. That's should be easy or I'm missing something?
from prismlauncher.
The offset in the file can vary, and instances are not necessarily so small. I think you can skip decompression though - but you still need to do a linear search! It's probably okay for local files (where you can skip stuff) but would be very bad for HTTP (unless you can do something fancy with ranges)...
from prismlauncher.
Related Issues (20)
- Hope to add server download function HOT 1
- [Feature Request] A config browser, similar to Gale Mod Manager HOT 4
- Resolution problem HOT 1
- modlist image and enabled column is too wide when window is not maximized; causes mod name tab to be too small HOT 1
- Option to compare instances HOT 1
- unable to log in HOT 3
- Add lunar client friendslist HOT 1
- System java versions not preferred over java downloader HOT 4
- opening instance "settings" page changes the version of java used to an incompatible version without any user input HOT 8
- Crash when looking through java download menu HOT 1
- Auto detecting java doesn't show javas in prisms java folder for macOS HOT 7
- Shorten mod update error description HOT 2
- HiDPI causes some textboxes in settings to be too small
- Add java folder to folders menu
- Stuck at "working" while trying to login into mojang account HOT 1
- Incompatible version of OpenSSL (built with OpenSSL >= 3.x, runtime version is < 3.x) HOT 2
- Large mod operations can be really unstable HOT 3
- Skin Manager crashes launcher when any skin file name contains more than one "." HOT 5
- Have a `Minecraft log` tab before the instance is launched too HOT 2
- performance tab on windows HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prismlauncher.