Войти

Показать полную графическую версию : Модифицированный SFX модуль 7-Zip'а для установок


Страниц : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 [78] 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

SergeyZV
07-12-2014, 20:29
Вышла версия 7-zip 9.35 Beta. Скачав с сайта lzma935.7z обнаружил в нем микроскопический модуль 7zS2.sfx. Очень хотелось бы, что бы был создан модифицированный модуль на его основе.

frankiesimon
31-01-2015, 01:56
Hi and apologies for using English on the board. (You can of course answer in Russian - appreciate it!)

My archive is a directory with files (MyDir), and the executable I want to run is inside it (MyProg.exe).

This is the basic configure file:
;!@Install@!UTF-8!
RunProgram="\"MyDir\\MyProg.exe\""
GUIMode="1"
;!@InstallEnd@!

The problem is that my .exe has dependencies and has to be run from its own folder, or these dependencies fail. (It loads plugins which are expected in the current dir, but can't find them because the current running folder is the dir containing MyDir).

My first idea was to use Directory but docs say:
"
Directory: Путь к папке команды исполнения 'RunProgram' (не путать с текущей папкой).
RunProgram="notepad.exe"
Directory="C:\\Windows\\system32\\"
равнозначны
RunProgram="C:\\Windows\\system32\\notepad.exe"
"
- so it's actually not helping me to define the "current directory".

My other solution was to change the RunProgram parameter to run a batch file: RunProgram="\"MyDir\\run.bat\"" and have this inside it:
"
cd MyDir
MyProg.exe
exit
"
The program runs, but I get a console window. If I use hidcon - there is no console window but also no program window for MyProg.exe.

Any other way to solve this?

spectat0r
31-01-2015, 02:26
;!@Install@!UTF-8!
GUIMode="1"
RunProgram="hidcon:cmd.exe /c start /b /d MyDir MyDir\MyProg.exe"
;!@InstallEnd@!

frankiesimon
31-01-2015, 18:45
Hi spectat0r, thank you for your suggestion. You led me to the right solution.

What I eventually did:
RunProgram="hidcon:\"MyDir\\run.bat\""

and in run.bat:
start /w /d "MyDir" MyProg.exe
exit

When I tried your suggestion of cmd.exe /c (closing the console immediately) then not all of the files in my archive were extracted! To confirm - as soon as I got the message box error about the missing .dlls I went to the Temp folder and saw what is in the archive. If I did /c then some of my .dlls are not there. I then tried cmd /k - and all files were there.

I don't know why this happens - but looks like the .bat file option (running in a hidden window, opening a new window for the program I actually want to see) works ok for me.

spectat0r
31-01-2015, 19:27
When I tried your suggestion of cmd.exe /c (closing the console immediately) then not all of the files in my archive were extracted! »
Сначала происходит полное извлечение архива, а затем выполняется файл конфигурации.
Если нужно ждать завершения работы MyProg.exe:
RunProgram="hidcon:start /w /d \"MyDir\" \"MyDir\\MyProg.exe\""
RunProgram="waitall:hidcon:start /w /d \"MyDir\" \"MyDir\\MyProg.exe\""
В данном случае run.bat не нужен.

gora
31-01-2015, 19:36
frankiesimon, spectat0r, для обсуждения файлов конфигурации есть специальная ветка (http://forum.oszone.net/thread-230888.html).
RunProgram="hidcon:start /w /d MyDir MyDir\MyProg.exe" »
spectat0r, ваш вариант работать не будет. Команда start будет выполняться только в пределах cmd.exe

frankiesimon
31-01-2015, 20:12
Thanks gora - I didn't see there's a separate thread for it. Maybe this should be added to the "sticky" first post on the top of the page.

I didn't understand from your correction to spectat0r - what would be the correct way to call my executable.

I still have a problem with my .bat file, because inside it I'm calling a path with "ü" characters:
start /w /d "DirnameWithü" MyProg.exe

and this fails. So if possible I'd like to have a correct "RunProgram" line and avoid using the .bat file at all.

Should I re-ask this question in the configuration file thread? (Post my full "requirements" in that thread?)

gora
31-01-2015, 20:23
Should I re-ask this question in the configuration file thread? »
Да. И приведите Ваш полный файл конфигурации с реальными путями и именами папок и файлов в тегах [CODE].

Petya V4sechkin
31-01-2015, 20:25
Maybe this should be added to the "sticky" first post on the top of the page
Добавил.

ya158
07-02-2015, 23:12
Сделал Конструктор инсталляторов на основе модифицированного SFX модуля 7-Zip'а (http://forum.oszone.net/thread-295084.html). Прошу, уважаемое комьюнити, протестировать и высказать свое мнение.

yurecnew
27-02-2015, 09:41
модуль 7zsd_deflate не распознаёт архив если в нём больше 1 файла

Ж.Д.А.Л.К.Е.Р.
10-03-2015, 13:56
Небольшая заметка, может кому будет полезной.

7zsdrc.exe (http://rghost.ru/8Dfs9d8bY) (25 Кб) - консольная утилита от Oleg_Sch (http://forum.oszone.net/member.php?userid=32441) для чтения/изменения ресурсов модифицированного модуля.

USAGE: 7zsdrc sfxfilename [switches]
Switches:
-a: Use ANSI encoding (default)
-o: Use OEM encoding
-fv "a.b.c.d": change file version
-pv "a.b.c.d": change product version
-vs "name=value"
-vi "filename": save version info to file
-i "icon_filename[,index]": change icon from icon_filename
-if "WxHxD": use icon format
-si "filename": save icon to .ico file
-sh: Shrink resource section
-sh1: Shrink resource section to actual data size
-f "filename": use command line from file 'filename'
-rsi: Resource section info

Примеры:
Экспорт свойств файла setup.exe в setup.res.
7zsdrc.exe setup.exe -vi setup.res

Применение команд записанных в file.res к файлу 7zsd_LZMA2.sfx.
7zsdrc.exe 7zsd_LZMA2.sfx -f file.res

Замена иконки модуля 7zsd_LZMA2.sfx иконкой из файла iconfile.ico.
7zsdrc.exe 7zsd_LZMA2.sfx -i iconfile.ico

Примечание:
Столкнулся с тем что некоторые ехе не используют всех полей в свойствах файла. Поэтому при экспорте свойств в файл пишутся пустышки, а когда применяем этот файл ресурсов на модифицированный модуль - возникают пустые поля. Решить эту проблему можно так:
7zsdrc.exe setup.exe -si iconfile.ico -vi setup.res
>setup-cut.res FindStr /v "="" setup.res
Move /y setup-cut.res setup.res >Nul
7zsdrc.exe 7zsd_LZMA2.sfx -i iconfile.ico -f setup.res
Команда FindStr отсекает пустышки, а модифицированный модуль (в примере 7zsd_LZMA2.sfx) должен быть без полей свойств (http://s020.radikal.ru/i708/1503/e6/4f77043c038b.jpg) (иначе не перезаписанные поля останутся и будет каша из копирайтов).

pokkk
10-03-2015, 20:09
7-Zip SFX https://yadi.sk/d/Al8x7jwRf9uhT
Sfx-Модуль для самораспаковуюшихся архивов 7z.
Вот как выглядит эта установка так и будут выглядеть твои архивы!

Инструкция. Заходим в папку SFX - BIG.
И там видим файлы:

1.7z
Архив (замените его на свой архив, обязательно 7z архив с методом сжатия LZMA )

C.txt
Текст с конфигурацией. Если нужно настройте под себя.
Как настраивать найдёте инфу в файле 7zSD_RU.chm

1.sfx
Оболочка нашего инсталятора.
Если хотите, можете её изменить обычным редактором ресурсов exe.

!GO.cmd
Файл который сделает инсталлятор с вашего архива.
Все эти файлы должны быть в одной папке с соблюдением имён файлов.

http://rupic.org/images/1rqr.png

pokkk
10-03-2015, 20:09
ПС. Ничего нового. Я просто пропатчил 7zsd_LZMA_Dialogs.sfx

pokkk
10-03-2015, 21:10
Ребята, кто мне может сделать sfx с диалогами для LZMA2 ?
gora, пишет Можете сделать самостоятельно в редакторе ресурсов. Возьмите ресурсы из *_Dialogs.sfx и добавьте их в выбранный модуль. Все вопросы задавайте на форуме Если может кто, то сделайте пожалуйста с этого sfx что я прикрепил.
У меня не получается. Пробовал в трех редакторах и не выходит.

pokkk
05-04-2015, 20:20
Нужно что бы модифицированный модуль мог распаковывать архивы разделённые на части.. есть такое?

Victor_Man
14-04-2015, 22:50
Ооопс!!!
А 7-Zip v15.0 создает архив несовместимый с модифицированным SFX :(
LZMA и LZMA2...

SergeyZV
15-04-2015, 06:23
А 7-Zip v15.0 создает архив несовместимый с модифицированным SFX »
Всё нормально создаётся, только с архивом LZMA нужно и такой же SFX модуль использовать и с LZMA2 соответственно.

Victor_Man
16-04-2015, 14:05
Цитата SergeyZV:
Всё нормально создаётся, только с архивом LZMA нужно и такой же SFX модуль использовать и с LZMA2 соответственно. »
Не понял....в модифицированном модуле же свои SFX.
Если взять стандартные из v15.0, то и возможностей расширенных там не будет.

SergeyZV
16-04-2015, 20:49
Не понял....в модифицированном модуле же свои SFX. »
Модифицированные модули разные! Одни для архивов LZMA, другие для LZMA2. И вроде я не писал про стандартные.
Скачайте архив 7zsd_extra_160_2712.7z (http://7zsfx.info/files/7zsd_extra_160_2712.7z) распакуйте и всё поймёте.




© OSzone.net 2001-2012