2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ubuntuでexe (7zの自己解凍書庫)作成

Last updated at Posted at 2013-10-30

自己解凍書庫の作成を自動化したく、ubuntuにp7zip-fullパッケージをインストールし
7z a -sfx test.exe ./で書庫を作成したが実行するとtoo big to fit in memoryとエラー終了。
ということで調べてみた。

必要なファイルをダウンロード

p7zip-fullをインストール

$ sudo apt-get install p7zip-full

7zsd.sfxの準備

  • 7zSD.sfxをダウンロード
    • 7zS2.sfx, 7zSD.sfx の SFXモジュールは lzma2301\bin\に含まれています。
  • 解凍する。

config.txtの作成

記述例。改行コードはdosにした。
;!@Install@!UTF-8!
Title="7-Zip 4.00"
;Directory="%Programfiles%\\program1"
InstallPath="%Programfiles%\\program1"
RunProgram="setup.exe"
;!@InstallEnd@!
  • 上記の例は、実行すると自動でc:\\Program Files\\program1に解凍され、c:\\Program Files\\program1\\setup.exeが実行される。

書庫を作成する

$ 7z a temp.7z ./
$ cat 7zsd.sfx config.txt temp.7z > selfextract.exe

windowsでselfextract.exeを実行すると解凍できることを確認。

追記

image.png

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?