Jump to content

How to make a 7-Zip Switchless Installer


keytotime

Recommended Posts

  • 2 weeks later...

Hi all,

Thanks for the great tut.

I have a small, but fatal (to me) problem with it. I hope you can help me out:

config.txt

;!@Install@!UTF-8!
RunProgram="program.exe"
GUIMode="2"
Progress="no"
;!@InstallEnd@!

copy /b 7zS.sfx + config.txt + 7zSFX.7z test.exe

I ve created the 7z archive using the latest 7zip - v 4.62 and the SFX module from the current tutorial.

When the "program.exe" is started the application window is not on focus, it appears to be behind the current window. It looses focus even if started from the Desktop

It is shown on the task bar but I have to switch to it manually. what bugz me out is that only happens like 30% of the starts .. some times it is on focus.

I checked the startup path and they are all started from diff folders in the temp folder and there is no pattern.

Thank you.

Edited by bojinov
Link to comment
Share on other sites

  • 1 month later...

Ok I'm having an issue (probably my inept scripting)

I'm trying to make Realtek's HD audio drivers & app install silently, in the readme it says

--------------------
Silent Installation:
--------------------

Run "Setup.exe /s /f2<path\LogFile> /z[-rp<path\LogFile>]"
i.e. setup.exe /s /f2c:\mylog.log /z[-rpC:\RHDSetup.log]

I tried all sorts of formating for it and none of it seems to work. The last one i tried I created the Config.txt containing an almost exact copy of their command and to no avail :sigh:

;!@Install@!UTF-8!
RunProgram=setup.exe /s /f2c:\test\mylog.log /z[-rpC:\RHDSetup.log]
;!@InstallEnd@!

Just get a msgbox with the header 7-zip and the message saying config failed

Could someone help me figure out how to setup the config.txt right please?

I just need to get this one driver/program to install silently and I'll have my whole boards devices slipstreamed into XPhome

If you need any extra info don't hesitate to ask!

Link to comment
Share on other sites

;!@Install@!UTF-8!
RunProgram=setup.exe /s /f2c:\test\mylog.log /z[-rpC:\RHDSetup.log]
;!@InstallEnd@!

RunProgram=setup.exe /s /f2c:\\test\\mylog.log /z[-rpC:\\RHDSetup.log]

IMPORTANT! Certain two-symbol sequences in the Value are parsed as follows:

\\ = \

\" = "

\n = caret return

\t = tabulation (TAB)

As a result, you MUST use DOUBLE backslashes (\\) wherever you normally use backslashes (\) (e.g. in paths or dialog texts). Similarly, if the Value contains double quotes ("), you MUST precede them with a backslash (\").

Link to comment
Share on other sites

Interesting...

I asked this on ryanvm forums and I was told I forgot the quotes

RunProgram="setup.exe /s /f2c:\test\mylog.log /z[-rpC:\RHDSetup.log]"

was their suggestion, which worked. However Im having difficulty with the PC being rebooted once the installer has ran, and realtek says the silent install shouldn't reboot the PC...

I'll try it with your code and see if I don't come out any better.

Nope, just tried your code and it's not working again

Edited by w00dr0w
Link to comment
Share on other sites

If the sfx extract the installer on the hdd and start installation from there works?

;!@Install@!UTF-8!
InstallPath="%temp%\\RHD"
RunProgram="setup.exe /s /SMS"
Delete="%temp%\\RHD"
GUIMode="2"
;!@InstallEnd@!

Link to comment
Share on other sites

If you need any extra info don't hesitate to ask!

Could it be your c:\mylog.log and C:\RHDSetup.log were in wrong location? As far as I understand, mylog.log or RHDSetup.log should normally be in same directory as your setup.exe. Just my guess.

Link to comment
Share on other sites

If you need any extra info don't hesitate to ask!

Could it be your c:\mylog.log and C:\RHDSetup.log were in wrong location? As far as I understand, mylog.log or RHDSetup.log should normally be in same directory as your setup.exe. Just my guess.

that just tells the install where to put the log of the install when it's installing.

ill have to try that other code here in a few, though having it run the manual installer would be undesirable, i guess i can manage

Link to comment
Share on other sites

It is my error, inverted commas in line are obligatory!!! Should be so:

RunProgram="setup.exe /s /f2c:\\test\\mylog.log /z[-rpC:\\RHDSetup.log]"

About syntax of the command

setup.exe /s /f2c:\mylog.log /z[-rpC:\RHDSetup.log]

I do not know, but if it works in bath a file in such kind and in a file of a configuration of the modified module will work. Check up its work at first in bath a file, and then already working variant transfer to a configuration file considering inverted commas and double slashes.

Edited by gora
Link to comment
Share on other sites

It is my error, inverted commas in line are obligatory!!! Should be so:

RunProgram="setup.exe /s /f2c:\\test\\mylog.log /z[-rpC:\\RHDSetup.log]"

About syntax of the command

setup.exe /s /f2c:\mylog.log /z[-rpC:\RHDSetup.log]

I do not know, but if it works in bath a file in such kind and in a file of a configuration of the modified module will work. Check up its work at first in bath a file, and then already working variant transfer to a configuration file considering inverted commas and double slashes.

I have the installer working, perfectly using this config.txt

;!@Install@!UTF-8!
RunProgram="setup.exe /s /f2c:\mylog.log /z[-rpC:\RHDSetup.log]"
;!@InstallEnd@!

with one exception

I'll post what I posted @ ryanvm forums

It's restarting the PC as soon as it's finished installing. I need to turn this off. I don't know if there's a parameter I can add to config.txt to keep it from restarting the PC, I checked the setup's .ini file and found some promising stuff, but I'm no coder and I have no clue what I need to do. So hopefully one of you can help me with this.

The interesting info in the setup.ini is below

[General Settings]
OEM = 0
DelDatUpd = 0
DelDatUni = 0
RtkLogON = 1
ForceSetupQFE = 0
ForceInstallRtk = 1
RtkAPODbgReg = 0
RtkAPOReg = 1
RemoveHDQFE = 0
QFEReboot = 0
fW2KForceRebt = 0
SilentReboot = 0
NUpgradeDrv = 0
NRunClsWin = 0
QFEOption = /o /norestart /passive
HideWinParm = /go

I tried adding /norestart to config.txt, but that doesn't do anything. I'm wondering if I can edit the .ini itself and change one of those flags to keep it from restarting after installing?

Once again your time, effort, and help are greatly appreciated...

large test

Link to comment
Share on other sites

What a great guide, thanks so much!

To automate the process even more:

1. Modify 7zs.sfx as desired according to OP's instructions

2. Copy 7zS.sfx to your SYSTEM32 directory

3. Enter the following into a batch file:

-------------------------------BEGIN CODE-------------------------------

@echo off

cls

%~d1

cd %~p1

echo Enter the command (e.g. "msistub setup.msi /qb-!") without quotes:

echo.

SET /P CMDLINE=

echo ;!@Install@!UTF-8! > config.txt

echo RunProgram="%CMDLINE%" >> config.txt

echo ;!@InstallEnd@! >> config.txt

copy /b %windir%\system32\7zs.sfx + config.txt + %1 %~n1.exe

del /q config.txt

------------------------------- END CODE -------------------------------

(The "code" tag messed up the echo commands)

4. Save batch file as %WINDIR%\System32\CreateInstaller.bat (save as UTF-8 as stated by original poster)

5. In Windows Explorer, Go to the "Tools\Folder Options"

6. under the "File Types" tab, go to the .7Z extension and click "Advanced"

7. Click "New..."

8. Under "Action" type "Create Installer" without quotes

9. Under "Application used to perform action" type

%WINDIR%\system32\CreateInstaller.bat "%1"

10. Now, right-click any .7Z file you want to convert into an installer, and click "Create Installer"

11. A DOS window will prompt you for the command you want to execute within the 7Z archive. Enter it without quotes.

12. Voila! The installer appears alongside the 7Z file.

Sorry I don't have time at the moment to upload screen shots. Just wanted to post this up. It's been a *great* tool for me. Thanks!

Edited by judolphin
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 months later...

Hello ppl

How do you know to make all the switches? & all the cmd commands?

i need a guide please for the switches

Thank you for your help...

Edited by ghostE
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...