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

Instructions for use #92

Open
jazir555 opened this issue Apr 1, 2019 · 12 comments
Open

Instructions for use #92

jazir555 opened this issue Apr 1, 2019 · 12 comments
Assignees

Comments

@jazir555
Copy link

jazir555 commented Apr 1, 2019

How do you compile this program to use it? How do does the program function? I want to combine/extract multipart cab files. There are no written instructions on how to use this, i would appreciate if you could update the description with a tutorial.

@twogood
Copy link
Owner

twogood commented Apr 2, 2019

Hi! What operating system are you using?

@jazir555
Copy link
Author

jazir555 commented Apr 2, 2019 via email

@twogood
Copy link
Owner

twogood commented Apr 2, 2019

Please go here to download unshield.exe:

https://ci.appveyor.com/project/twogood/unshield/build/artifacts

@twogood twogood self-assigned this Apr 2, 2019
@twogood
Copy link
Owner

twogood commented Apr 4, 2019

Did it work for you @jazir5 ?

@gingerbeardman
Copy link

gingerbeardman commented Mar 4, 2020

I'm a very proficient macOS user and former Apple engineer, yet I had trouble getting anything out of unshield for a short while.

Finally, I did this:
unshield -d data1 x data1.cab

and then this:
unshield -d data2 x data2.cab

To get what I needed.

Note: no trailing filename or wildcard is needed.

@twogood
Copy link
Owner

twogood commented Mar 4, 2020

Sorry for the non-obviousness @gingerbeardman !

The syntax with x to extract is meant to be similar to that of tar.

You should not need to extract individual .cab files, just run it on data1.cab and you should get all files.

@ericchristoffersen
Copy link

ericchristoffersen commented Mar 11, 2020

Hi People. First, I'm really glad this project exists. It was about 6 hours for me to get at the files I wanted.

What I wasn't happy about was a nearly endless set of problems with compiling and then running the program on native windows. Mostly the issues were with limitations and assumptions in the file parsing and construction code and I was maybe unlucky with some directory name choices. I don't see how windows people are supposed to use this if the directory separators are hard coded as '/'. What is the environment that this is supposed to run in on windows?

I finally lost it dealing with whatever visual studio was doing with cmake and then all the disjoint dependencies so pasted all the sources I needed into a new directory and hoovered them into a new vs2019 project - that let me iterate quickly. I still link a separate zlib but I slammed everything else under one roof, and then c++'d it.

I rewrote a bunch of the string and file parsing so work more robustly. I'm sorry I'm not playing well with others but this was expedient for me. Is there any interest in the changes here? Or should I just paste the sources up somewhere else. I used std::filesystem::path which worked really well. And regex was nice to eliminate more crazy. I have no idea about linux builds though, what assumptions I've violated especially wrt wchar_t and how difficult it might be to adapt it back to linux and non-cxx17 toolchains.

Edit: command I use now for unpack is:

unshield.exe -D 3 -d "d:\data\file 19.23 x1\output" x "d:\unpacktest.1\data2.cab"

The -D 3 lets me see all the intermediate stuffs which was useful until it finally started working.

Edit 2: Dumped it here:

https://github.com/ericchristoffersen/Unshield_MSVC2019

@twogood
Copy link
Owner

twogood commented Mar 12, 2020

@ericchristoffersen Sorry about the Windows build issues, all Windows stuff is contributed and barely supported :) I'm glad you could make it work for your case! Maybe I should just kill the Windows "support" and request that people run unshield in Windows Subsystem for Linux (WSL)?

@ericchristoffersen
Copy link

Wow. Cool. I had no idea that the WSL existed. Not sure I want to spend my system drive space for that but... sorta cool.

The advice to not use windows would be a solid minimum. I can't understand in what way windows is supported today. Its really, really not. :) Either that or I totally missed the boat.

The existing directory code is just terrible with weird restrictions and it hurts linux as well. No support for unicode paths?

That new std::filesystem stuff is pretty terrific. For example there's a function called:

std::filesystem::create_directories

That would let you delete a bunch of mank.

I made more changes today - now almost everything is an object and data is kept in vectors.

Simpler and cleaner.

Thanks again for supprting this source and making it available here. I really appreciate it existing. The alternatives to porting this were vile.

@twogood
Copy link
Owner

twogood commented Mar 13, 2020

@ericchristoffersen What zlib buld did you use? Because I think the primary issue with building unshield on Windows is that it can be built with different toolchains and the dependencies can be downloaded in various ways. And when adding support for one way, the other ones easily break.

@ericchristoffersen
Copy link

ericchristoffersen commented Mar 13, 2020

Building: zlib was no problem. Cmake ingestion by visual studio 2017 was a problem, I blame msvc, it totally ran off the rails and made a huge mess for this project.

The real issue is that once the sources are built this project totally won't work because it is hard coded to use '/' as a directory separator. Is hard coded to unix ascii paths. Plenty of cases throughout the project but first example look at the implementation of:

static bool make_sure_directory_exists(const char* directory)/*{{{*/

Which is called from extract_file:

static bool extract_file(Unshield* unshield, const char* prefix, int index)

See all the string processing and the hard coded forward slashes? The search for the '.'?

Here is more portable c++ version:

https://github.com/ericchristoffersen/Unshield_MSVC2019/blob/4b34e819bf7f1b43b6abb9d35f389c8cf706c894/src/unshield.cpp#L327

Really you should check out std::filesystem, is pretty cool, can eliminate a lot of old boilerplate.

@twogood
Copy link
Owner

twogood commented Mar 13, 2020

I'm pretty sure that the Windows APIs handle forward slashes just fine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants