Jump to content

7z SFX Modified Module and Tools


Oleg_Sch

Recommended Posts


Hi,

Anyone can help me adding the follwoing commands into my config.txt?

attrib -R "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Settings.ini" /S /D
COPY /Y "%~dp0Settings.ini" "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\"
SET KEY=HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\Program Files\Windows Sidebar\sidebar.exe" /f

I'll apprciate yr help

Regards

Link to comment
Share on other sites

SetEnvironment="KEY=HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce"
RunProgram="hidcon:attrib -R \"%userprofile%\\AppData\\Local\\Microsoft\\Windows Sidebar\\Settings.ini\" /S /D"
RunProgram="hidcon:cmd /c COPY /Y Settings.ini \"%userprofile%\\AppData\\Local\\Microsoft\\Windows Sidebar\\\""
RunProgram="hidcon:cmd /c REG ADD %KEY%\\001 /V 1 /D \"%systemdrive%\\Program Files\\Windows Sidebar\\sidebar.exe\" /f"

File Settings.ini should be at the root of the archive

Link to comment
Share on other sites

having issues with the 7zsd_All.sfx module everytime it extracts it extracts to a temp folder not the folder i specify and then it tries running setup.exe which i dont have as im using the archive to run a batch file to help with an uninstaller im making that uses a mix of batch vbs and hta to allow option selection then run based on options chosen any idea's on how to do this?

Link to comment
Share on other sites

having issues with the 7zsd_All.sfx module everytime it extracts it extracts to a temp folder not the folder i specify and then it tries running setup.exe which i dont have as im using the archive to run a batch file to help with an uninstaller im making that uses a mix of batch vbs and hta to allow option selection then run based on options chosen any idea's on how to do this?

Post your config.txt and make sure not to use a SFX that you split using 7zsplit because it will retain the previous config.txt

Link to comment
Share on other sites

this is my config file its pretty simple

;!@Install@!UTF-8!

GUIMode="1"

Skip="yes"

path="sounds"

;!@InstallEnd@!

im using the 7zsd_All.sfx modual from the 1.5 beta iv also tried with like 5 other modules and getting to my wits end

all i want it to do is so the extraction then run a vbs or batch file(depending on if i use the hide option from the module)

(note i forgot the run command in the config file because i was testing without it)

Link to comment
Share on other sites

;!@Install@!UTF-8!

GUIMode="1"

Skip="yes"

path="sounds"

;!@InstallEnd@!

Where did you find these parameters?

These parameters does not exist!

(note i forgot the run command in the config file because i was testing without it)

Can not be tested without the run command!

Link to comment
Share on other sites

the skip and path parameters were from a differnt site on google i was originally using the ones from 7zsfx.info but then switched around heres a altered version

;!@Install@!UTF-8!

GUIMode="1"

InstallPath="s"

RunProgram="test.bat"

;!@InstallEnd@!

note that test.bat may be replaced with a differnt one altogether or removed if i decide to use a start with wait from the cmd in my uninstaller

if i do the cmd batch will simnply say to start /wait "sounds.exe" "%path%\sounds.exe"

%path% will be defined earlier in the batch or defined as a differnt variable like %var%

Edited by red death68
Link to comment
Share on other sites

Hi,

The modified .sfx modules are great: they're the basis for all of my tools. In fact, my most important tool is an sfx-based tool that makes other sfx-based tools by providing a customized command line interface to build the config.txt file, specify the files to be zipped and included, and to copy everything to the .exe file.

(That tool, makeexe.exe can be found here Download MakeExe.exe. Unzip it and then type MakeExe.exe /? and/or use 7z to unpack it and see the internal parts and readme files. I've also attached MakeExe.exe here.)

At any rate, I have a great need to know the directory from which a tool is called, because many of my tools have relative file and/or directory names as parameters, for example:

myuncompress.exe dir1 dir2 ...

I need something like:

myuncompress.exe -SetEnvironment="MY_CD=%CD%" dir1 dir2 ...

only where the

-SetEnvironment="MY_CD=%CD%"

is instead done either in config.txt and/or is supplied by a new intrinsic variable akin to %%T or %%S,

because I don't won't my users to have to specify irrelevant information as a tool parameter.

I've tried several things and none work.

For instance, including

SetEnvironment="MY_CD=%%CD%%" into config.txt merely yields:

MY_CD=%CD%

when the archive program accesses MY_CD.

The situation is hopeless if a system temp directory is used for the extraction, so when I need a program that uses

relative file/directory names, I have the archive extracted into a directory relative to the invoking directory with

a config.txt file similar to the following:

;!@Install@!UTF-8!

SetEnvironment="USE_TEMP_DIR=NO"

InstallPath=".\\TempExtractDiretory"

SetEnvironment="EXTRACT_DIR=%%T"

GUIMode="1"

ExtractTitle="Extracting myuncompress.bat"

RunProgram="myuncompress.bat"

Delete="%%T"

;!@InstallEnd@!

Inside myuncompress.bat, I have code like

Set SavedExtractDir=%CD%

IF DEFINED EXTRACT_DIR (

IF /I "%USE_TEMP_DIR%" NEQ "YES" (CD ..)

)

to decide if the extraction directory is relative to the calling directory, and then by doing

CD ..

I can obtain the directory from which the archived program was invoked.

It would be so much simpler, so much more useful, and so much more elegant if a new variable like %%C

was made available to indicate the invoking directory. (Note that %%S does not work because that is the

location of the archive program and not the directory from which it was invoked.)

(Another possibility would be to add another well-defined environmental variable %InvocationDirectory% that contains the directory path of the invoking directory, similar to %CommonDesktop%, %CommonDocuments%, etc.)

Thanks, Asok.

PostScript:

Well, at least I now know why

SetEnvironment="MY_CD=%%CD%%"

does not work.

The source code uses the "ExpandEnvironmentStrings" string function to expand environmental variables, but a community comment on the MS msdn.microsoft.com web page that documents this functions notes:

"The 'CD' and 'ERRORLEVEL' values are not expanded

Note that this function really doesn't work the same way as the CMD shell at all -- like the documementation notes, it doesn't do the fancy expansion. But it also doesn't expand the CD or ERRORLEVEL "variables" either."

I really need for the source code to make a call to GetCurrentDirectory and put the results in an evironmental value, because that looks like that is the only way this information will be available to the user program.

MakeExe.zip

Edited by Asok
Link to comment
Share on other sites

  • 3 weeks later...

haiiiiiiiiiiiiiiiiii

I need to copy some files to c:\

i used this code but not working :

--------------------------------------------

;!@Install@!UTF-8!

GUIMode="2"

RunProgram="cmd /c xcopy *.* \"%SystemDrive%" /y /h"

;!@InstallEnd@!

---------------------------------------------

What the true code i used to copy????????????

Link to comment
Share on other sites

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="cmd /c xcopy *.* \"%SystemDrive%\" /y /h"
;!@InstallEnd@!

Probably because you were missing a backslash from one of your quotes

Edit: try this slightly improved version (hides console window and added %%T=full extraction path)

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="hidcon:xcopy \"%%T\\*.*\" \"%SystemDrive%\" /y /h"
;!@InstallEnd@!

Edited by ricktendo64
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...