7zip를 이용해서 setup.exe와 같이 실행형 압축파일 만들기
How to make a self extracting archive that runs your setup.exe with 7zip -sfx switch
Step 1 - Setup your installation folder
To make this easy create a folder c:\Install. This is where we will copy all the required files.
Step 2 - 7Zip your installers
1. Go to the folder that has your .msi and your setup.exe
2. Select both the .msi and the setup.exe
3. Right-Click and choose 7Zip --> "Add to Archive"
4. Name your archive "Installer.7z" (or a name of your choice)
5. Click Ok
6. You should now have "Installer.7z".
7. Copy this .7z file to your c:\Install directory
Step 3 - Get the 7z-Extra sfx extension module
You need to download the 7z-Extra.
1. Follow this link to go to download 7Zip
2. You need to download the 9.20 version (as @ May-2015) as the beta does not contain the correct files.
3. A direct download link.
4. Extract the 7zip extra files
5. Copy the file "7zS.sfx" to c:\Install
Step 4 - Setup your config.txt
I would recommend using NotePad++ to edit this text file as you will need to encode in UTF-8, the following instructions are using notepad++.
1. Using windows explorer go to c:\Install
2. right-click and choose "New Text File" and name it config.txt
3. right-click and choose "Edit with NotePad++
4. Click the "Encoding Menu" and choose "Encode in UTF-8"
5. Enter something like this:
6. ;!@Install@!UTF-8!
7. Title="SOFTWARE v1.0.0.0"
8. BeginPrompt="Do you want to install SOFTWARE v1.0.0.0?"
9. RunProgram="setup.exe"
10. ;!@InstallEnd@!
Edit this replacing [SOFTWARE v1.0.0.0] with your product name. Notes on the parameters and options for the setup file are here
CheckPoint
You should now have a folder "c:\Install" with the following 3 files:
1. Installer.7z
2. 7zS.sfx
3. config.txt
Step 5 - Create the archive
These instructions I found on the web but nowhere did it explain any of the 4 steps above.
1. Open a cmd window, Window + R --> cmd --> press enter
2. In the command window type the following
3. cd \
4. cd Install
5. copy /b 7zS.sfx + config.txt + Installer.7z MyInstaller.exe
6. Look in c:\Install and you will now see you have a MyInstaller.exe
You are finished
Run the installer
Double click on MyInstaller.exe and it will prompt with your message. Click OK and the setup.exe will run.
P.S. Note on Automation
Now that you have this working in your c:\Install directory I would create an "Install.bat" file and put the copy script in it.
copy /b 7zS.sfx + config.txt + Installer.7z MyInstaller.exe
Now you can just edit and run the Install.bat every time you need to rebuild a new version of you deployment package.
'C#' 카테고리의 다른 글
WebView의 PDF 읽기 실패, Adobe PDF 오류(103:103)에 대한 처리 해결법 (0) | 2022.09.15 |
---|---|
C#에서 Chrome 브라우저 사용 + 웹 소스에서 자바스크립트로 C# 함수 호출하기 (CefSharp / Chromium) (0) | 2021.01.15 |
Visual Studio 2017 Preview 설치 (0) | 2018.08.17 |
NSIS 스크립트 방식의 윈도우 인스톨링 프로그램 (0) | 2018.06.09 |
HTTP 411 오류? The remote server returned an error: (411) Length Required. (0) | 2018.05.05 |
C# IP, Email 스팸 패턴으로 Spam 메일 차단하기 + 문자열 배열에 비교 (0) | 2018.04.26 |
Visual Studio 2017 프로그램 Update 하기 (0) | 2018.04.21 |
C# 사설 / 공인 IP 구하기 ( Internal / External IP Address ) (0) | 2018.04.20 |
(로그인하지 않으셔도 가능)