MSFN Forum: 7z SFX Modified Module and Tools - MSFN Forum

Jump to content


Unattended CD/DVD Guide Homepage · MSFN Forum Rules

Welcome to the Applications Installs forum. Make sure you read the forum rules before you start posting.

Links/Requests to warez and/or any illegal material (porn, cracks, serials, etc..) will not be tolerated. Discussion of circumventing WGA/activation/timebombs/keygens or any other illegal activity will also not be tolerated.

We try our best to keep this forum clean of illegal content. If you see any illegal activity use the "report" button you find in every post to report the specific post to the moderators. If you ignore any of the rules you will be banned without notice.

Read Forum Rules
  • 22 Pages +
  • « First
  • 12
  • 13
  • 14
  • 15
  • 16
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

7z SFX Modified Module and Tools Rate Topic: -----

#261 User is offline   gora 

  • Member
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 09-August 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 30 June 2011 - 08:03 AM

When you see the version 1.5, version 1.4 is frozen (1.4-RC1 (build 1898) 10/08/10). Version 1.4 is fixing bugs and recompileon the basis of the source new stable versions of the archiver 7-zip only.
After this date may appear new in version 1.5. See for details the history of version (1.5 since version 1.5 develop (build 1794) 26/06/10)

PS
I always use the latest beta version. The latest beta version always has a full set of features described in the Help file and its reliability does not yield a stable version.

This post has been edited by gora: 30 June 2011 - 08:13 AM



#262 User is offline   visegrip 

  • Newbie
  • Group: Members
  • Posts: 36
  • Joined: 19-October 08

Posted 30 June 2011 - 04:30 PM

Thanks gora,
I just looked through the log for 1.5.0.2100 from revision 1 - 80 and make out four feature additions:

1."waitall" prefix ('wait all childs' of the executed process)
2. MiscFlag '4' - run as administrator
3. BeginPrompt timeout
4. New module variable %%P - OS platform

Also, one initial addition has been removed:
Deletion of redefined config parameters "Parameter=-"

As far as differences from version 1.4.1.2100, is this list correct and complete?
Thanks again.

#263 User is offline   gora 

  • Member
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 09-August 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 30 June 2011 - 10:03 PM

View Postvisegrip, on 30 June 2011 - 04:30 PM, said:

As far as differences from version 1.4.1.2100, is this list correct and complete?

Quote

1.5 beta (build 2088) 16/04/11
# Dialogue '-sfxversion'

1.5 alpha (build 1978) 12/27/10
# Changed the logic in the switch '-!', removed forced the leading space

1.5 alpha (build 1951) 30/11/10
+ Displaying the support volume (switch '-sfxversion')

1.5 alpha (build 1948) 27/11/10
+ Support volume
+ Option 'VolumeNameStyle' in the configuration file

1.5 alpha (build 1937) 11/16/10
+ Support for encryption of archives
+ Options 'PasswordTitle' and 'PasswordText' in the configuration file
+ Switch '-pX'
+ Flag 8 'MiscFlags' - the password prompt dialog after 'BeginPrompt' and 'ExtractPath' or 'BeginPrompt' + 'ExtractPath'

1.5 alpha (build 1928) 07/11/10
+ Module variable %%P - the operating system platform

1.5 alpha (build 1922) 01/11/10
# Changes related to batch build

1.5 develop (build 1912) 10/22/10
+ Flag 16384 'GUIFlags' to display the '&' in the texts of the dialogues

1.5 develop (build 1899) 10/09/10
# Changed processing logic of language sections

1.5 develop (build 1898) 08/10/10
+ Option 'BeginPromptTimeout' in the configuration file
+ Switch '-bptX'

1.5 develop (build 1799) 01/07/10
+ Support Windows7 PCA in the manifest

1.5 develop (build 1795) 27/06/10
+ Flag 4 'MiscFlags' to run with elevated privileges

1.5 develop (build 1794) 26/06/10
+ The prefix 'waitall' expectations for the completion of all child processes


#264 User is offline   visegrip 

  • Newbie
  • Group: Members
  • Posts: 36
  • Joined: 19-October 08

Posted 30 June 2011 - 11:10 PM

Thanks again, gora!
Where exactly is that history file so I don't have to ask again in the future?

#265 User is offline   gora 

  • Member
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 09-August 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 30 June 2011 - 11:16 PM

Help File -> History changes -> Beta versions

See Russian Help only!
No English help, since, none of the English-speaking users do not want to translate it into English! :(

This post has been edited by gora: 30 June 2011 - 11:22 PM


#266 User is offline   vonmillhausen 

  • Group: Members
  • Posts: 3
  • Joined: 22-June 11
  • OS:none specified
  • Country: Country Flag

Posted 04 July 2011 - 05:11 PM

Hi Gora,

I had posted a question on the previous page (13) about getting the return code of an executable run by 7zSfx. I've downloaded, modified and compiled the source, but I've run into a problem linking to msvcrt.dll.

Your official released version of 7zSfx links to msvcrt.dll and not to any of the VC++ version specific MSVCrt DLL files (eg, msvcr100.dll). This is good, as it means that machines don't need to have a specific version of the VC++ Redistributable installed for 7zSfx to work on them. I want to replicate this behavior, which does not appear to be the standard for VC++ setups.

From reading about this issue, it appears to be solved by linking to a specific version of the msvcrt.lib file, one that links to msvcrt.dll and not any of the other DLL files. I've tried the version that comes with the Windows Driver Developer Kit, and although the stub compiles fine, it only executes on Windows 7 machines (appears to require the Windows 7 version of msvcrt.dll).

I see in config.cpp that you have pragma links to msvcrt.lib in "C:/Mobile/Develop/Lib/VC8/<platform>/msvcrt.lib" - could you tell me exactly what versions of msvcrt.lib those are? Are they the versions provided with VC++ 2005? My development box has VC++ 2008 (on Windows 7) so maybe that's the problem... would you by any chance be able to temporarily provide me with a download link to those two .lib files?

Failing that, if I provided you with the two extra lines of code to capture and report the return-code of the last run executable, could I persuade you to build me a custom version of the current stable LZMA 32bit stub?

Cheers!


John

This post has been edited by vonmillhausen: 04 July 2011 - 05:24 PM


#267 User is offline   YumeYao 

  • a RyanVM.net member
  • Pip
  • Group: Members
  • Posts: 73
  • Joined: 10-December 05

Posted 14 July 2011 - 09:02 AM

BUG on macro _SFX_USE_LANG. (Version 141_2100)

main.cpp
	AString strSignatureBegin;
	AString strSignatureEnd;

#ifdef _SFX_USE_LANG
	CreateLanguageSignature( idSfxLang, strSignatureBegin, strSignatureEnd );
#endif // _SFX_USE_LANG
	if( ReadConfig( inStream, strSignatureBegin, strSignatureEnd, config ) == false ) /* DANGER!!!! arg2 and arg3 not inited!!!! */
	{     /* BUG!!!!! NEVER REACH HERE!!! Because ReadConfig Easily Find the Signature of NULL and consider it have found the signature. */
		if( ReadConfig( inStream, kSignatureConfigStart, kSignatureConfigEnd, config ) == false )
		{
			SfxErrorDialog( FALSE, ERR_READ_CONFIG );
			return ERRC_READ_CONFIG;
		}
	}

This code will leave strSignatureBegin and strSignatureEnd not initialized and therefore the sfx doesn't work.



The fix I'm using:
#ifdef _SFX_USE_LANG
	AString strSignatureBegin;
	AString strSignatureEnd;

	CreateLanguageSignature( idSfxLang, strSignatureBegin, strSignatureEnd );
	if( ReadConfig( inStream, strSignatureBegin, strSignatureEnd, config ) == false )
	// if fall through
#endif // _SFX_USE_LANG
	if( ReadConfig( inStream, kSignatureConfigStart, kSignatureConfigEnd, config ) == false )
	{
		SfxErrorDialog( FALSE, ERR_READ_CONFIG );
		return ERRC_READ_CONFIG;
	}


#268 User is offline   YumeYao 

  • a RyanVM.net member
  • Pip
  • Group: Members
  • Posts: 73
  • Joined: 10-December 05

Posted 14 July 2011 - 09:14 AM

View Postvonmillhausen, on 04 July 2011 - 05:11 PM, said:

Hi Gora,

I had posted a question on the previous page (13) about getting the return code of an executable run by 7zSfx. I've downloaded, modified and compiled the source, but I've run into a problem linking to msvcrt.dll.

Your official released version of 7zSfx links to msvcrt.dll and not to any of the VC++ version specific MSVCrt DLL files (eg, msvcr100.dll). This is good, as it means that machines don't need to have a specific version of the VC++ Redistributable installed for 7zSfx to work on them. I want to replicate this behavior, which does not appear to be the standard for VC++ setups.

From reading about this issue, it appears to be solved by linking to a specific version of the msvcrt.lib file, one that links to msvcrt.dll and not any of the other DLL files. I've tried the version that comes with the Windows Driver Developer Kit, and although the stub compiles fine, it only executes on Windows 7 machines (appears to require the Windows 7 version of msvcrt.dll).

I see in config.cpp that you have pragma links to msvcrt.lib in "C:/Mobile/Develop/Lib/VC8/<platform>/msvcrt.lib" - could you tell me exactly what versions of msvcrt.lib those are? Are they the versions provided with VC++ 2005? My development box has VC++ 2008 (on Windows 7) so maybe that's the problem... would you by any chance be able to temporarily provide me with a download link to those two .lib files?

Failing that, if I provided you with the two extra lines of code to capture and report the return-code of the last run executable, could I persuade you to build me a custom version of the current stable LZMA 32bit stub?

Cheers!


John

Get WinDDK 2003 SP1 and use the CRT headers from it and lib (msvcrt.lib) from it.

Additionally, if you have VC6, you can use the lib from it. (But the CRT header should be from DDK 2003 SP1 or Win7 DDK for bug-free).

#269 User is offline   Oleg_Sch 

  • Newbie
  • Group: Members
  • Posts: 32
  • Joined: 09-July 07

Posted 14 July 2011 - 03:52 PM

YumeYao, thanks
This not "danger", because strSignature* are initialized to "empty strings", but this is a "bug".
I'll fix it in next update.

#270 User is offline   YumeYao 

  • a RyanVM.net member
  • Pip
  • Group: Members
  • Posts: 73
  • Joined: 10-December 05

Posted 14 July 2011 - 11:48 PM

I just built a self-made version for my need yesterday and I encountered this bug so I just fixed it. It's really dangerous because people who want to turn it off will and doesn't test it will have the wrong sfx then wrong exe.

BTW, I have several suggestions( some already done by me locally) to you:
  • Dialog Version
    I see you're actually telling dialog version apart from non-dialog version by looking for the dialog resources, in other words, the code is same.
    I think you may want to let user manually add dialogs to versions other than LZMA, but this is not documented.

    Anyway, in my self-made version, I modified the code to fully disable dialogs, reducing the sfx by 1.5KB.
  • Russian
    Not to be offensive, but I don't think it's good to add them in the code, or we may need a macro to turn it off. The strings takes too much spaces.

    Also, you may think save langstrs.cpp as UTF-8, so that users using other languages can compile it without modifications.
  • RTF support on non-dialog versions
    Well, I tried adding it but failed. But I have some solutions that may work:

    Getting the Width:
    1. Set RTF Control to max width(as the window allows)
    2. Get line count. (EM_GETLINECOUNT)
    3. Set RTF Control to (it's previous width)/2
    4. Get line count, if equals to previous, goto 3, otherwise goto 5
    5. Set RTF Control to (it's previous width)-10
    6. Get line count, if equals to previous, goto 5, otherwise goto 7
    7. Set RTF Control to (it's previous width)-1
    8. Get line count, if equals to previous, goto 7, otherwise goto 9
    9. Done. Previous width(=current width + 1) is what we need.

    Getting the height:
    1. Get the text
    2. Add "\par " to the end. (There must be 2 spaces, first space is omitted because it follows a \par.)
    3. Set the text.
    4. Get line count. (EM_GETLINECOUNT)
    5. Get line index of last line(last return value -1). (EM_LINEINDEX) This index is the white space we just added.
    6. Get the position of the white space (EM_POSFROMCHAR), the y-offset is the height.
    7. Restore the text to before to not make user confusing(using arrow keys can move the cursor to the invisible white space).

This post has been edited by YumeYao: 15 July 2011 - 12:00 AM


#271 User is offline   Oleg_Sch 

  • Newbie
  • Group: Members
  • Posts: 32
  • Joined: 09-July 07

Posted 15 July 2011 - 02:41 AM

Quote

Dialog Version
I see you're actually telling dialog version apart from non-dialog version by looking for the dialog resources, in other words, the code is same.
I think you may want to let user manually add dialogs to versions other than LZMA, but this is not documented.

Yes, you are right and user can manually add custom dialogs to any modules. I do not have enough time to develop, especially for documentation.

Quote

Russian
Not to be offensive, but I don't think it's good to add them in the code, or we may need a macro to turn it off. The strings takes too much spaces.

This is historical issue (if you don't know, I'm from Russia), may be later I will change this.

Quote

RTF support on non-dialog versions

More complex. I'll write PM to you in near week.

#272 User is offline   skEwb 

  • Group: Members
  • Posts: 6
  • Joined: 19-July 11
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 July 2011 - 10:33 AM

Can someone please help me point out what I'm doing wrong here? These commands work fine if executed in a regular shell, however it gives this error when executed from within the SFX

Error in line 5 of configuration data:


;!@Install@!UTF-8!
OverwriteMode="1"
RunProgram="hidcon:cmd /c %APPDATA%\WhileIdle\WhileIdle.exe"
RunProgram="hidcon:cmd /c REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run\ /f /v Whileidle /d "\"%APPDATA%\WhileIdle\WhileIdle.exe\"""
InstallPath="%APPDATA%\WhileIdle"
GUIMode="2"
;!@InstallEnd@!


It specifically complains about this part "\"%APPDATA%\WhileIdle\WhileIdle.exe\"""

Screenshot

This post has been edited by skEwb: 19 July 2011 - 10:42 AM


#273 User is offline   gora 

  • Member
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 09-August 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 July 2011 - 11:07 AM

;!@Install@!UTF-8!
OverwriteMode="1"
RunProgram="hidcon:cmd /c \"%APPDATA%\\WhileIdle\\WhileIdle.exe\""
RunProgram="hidcon:REG ADD HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /f /v Whileidle /d \"\\\"%APPDATA%\\WhileIdle\\WhileIdle.exe\\\"\""
InstallPath="%APPDATA%\\WhileIdle"
GUIMode="2"
;!@InstallEnd@!



#274 User is offline   skEwb 

  • Group: Members
  • Posts: 6
  • Joined: 19-July 11
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 July 2011 - 11:51 AM

View Postgora, on 19 July 2011 - 11:07 AM, said:

;!@Install@!UTF-8!
OverwriteMode="1"
RunProgram="hidcon:cmd /c \"%APPDATA%\\WhileIdle\\WhileIdle.exe\""
RunProgram="hidcon:REG ADD HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /f /v Whileidle /d \"\\\"%APPDATA%\\WhileIdle\\WhileIdle.exe\\\"\""
InstallPath="%APPDATA%\\WhileIdle"
GUIMode="2"
;!@InstallEnd@!




Thank you :)

The error is now fixed, however the registry entry doesn't get added, if the line is used in a shell it gives this output:

WindowsXP

C:\Documents and Settings\Administrator>REG ADD HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /f /v Whileidle /d \"\\\"%APPDATA%\\WhileIdle\\WhileIdle.exe\\\"\

Error:  Too many command-line parameters


Windows 7:

C:\Users\Administrator>REG ADD HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /f /v Whileidle /d \"\\\"%APPDATA%\\WhileIdle\\WhileIdle.exe\\\"\"

ERROR: Invalid key name.

Type "REG ADD /?" for usage.


My guess is that it's not supposed to work being interpreted by a standard Windows shell and only 7-Zip SFX interprets it correctly?

The program installs and triggers to execute, however, the registry entry isn't added.

This post has been edited by skEwb: 19 July 2011 - 11:53 AM


#275 User is offline   gora 

  • Member
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 09-August 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 July 2011 - 11:58 AM

I did not check your line for availability. I gave her the syntax of the module only. Write a string to add the registry entry for a batch file which you work and adds information to the registry correctly.

PS
Syntax strings in a module and a batch file are not equal

This post has been edited by gora: 19 July 2011 - 12:00 PM


#276 User is offline   skEwb 

  • Group: Members
  • Posts: 6
  • Joined: 19-July 11
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 July 2011 - 12:04 PM

View Postgora, on 19 July 2011 - 11:58 AM, said:

I did not check your line for availability. I gave her the syntax of the module only. Write a string to add the registry entry for a batch file which you work and adds information to the registry correctly.

PS
Syntax strings in a module and a batch file are not equal


Thank you for the suggestion, I will do it this way. Thank you so much for your help again.

#277 User is offline   gora 

  • Member
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 09-August 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 July 2011 - 12:20 PM

write to the registry key is in the format of reg file, I will translate it into the syntax of the module

#278 User is offline   skEwb 

  • Group: Members
  • Posts: 6
  • Joined: 19-July 11
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 July 2011 - 01:09 PM

View Postgora, on 19 July 2011 - 12:20 PM, said:

write to the registry key is in the format of reg file, I will translate it into the syntax of the module


This regadd.bat works for now:

@echo off
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run\ /f /v Whileidle /d "\"%APPDATA%\WhileIdle\WhileIdle.exe\""

This post has been edited by skEwb: 19 July 2011 - 01:15 PM


#279 User is offline   gora 

  • Member
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 09-August 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 July 2011 - 01:33 PM

RunProgram="hidcon:Reg Add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"Whileidle\" /t REG_SZ /d \"\\\"%APPDATA%\\WhileIdle\\WhileIdle.exe\\\"\" /f"


This post has been edited by gora: 19 July 2011 - 01:34 PM


#280 User is offline   skEwb 

  • Group: Members
  • Posts: 6
  • Joined: 19-July 11
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 July 2011 - 02:42 PM

Hey this unfortunately does not add anything in the registry on WXP and W7.

View Postgora, on 19 July 2011 - 01:33 PM, said:

RunProgram="hidcon:Reg Add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"Whileidle\" /t REG_SZ /d \"\\\"%APPDATA%\\WhileIdle\\WhileIdle.exe\\\"\" /f"




What is the proper way to call a bat file from withing the config.txt ? Does this look normal:

;!@Install@!UTF-8!
OverwriteMode="1"
RunProgram="hidcon:cmd /c \"%APPDATA%\\WhileIdle\\WhileIdle.exe\""
RunProgram="hidcon:cmd /c \"%APPDATA%\\WhileIdle\\regadd.bat\""
InstallPath="%APPDATA%\\WhileIdle"
GUIMode="2"
;!@InstallEnd@!


Contents of bat file:

@echo off
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run\ /f /v Whileidle /d "\"%APPDATA%\WhileIdle\WhileIdle.exe\""


That config.txt doesn't run the .bat file either, even though the .bat file is tested locally to be 100% working.

======Back to Registry Method==========

The following line has some edits that work on both WXP and W7.

cmd /c "reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v Whileidle /t REG_SZ /d \""%APPDATA%\WhileIdle\WhileIdle.exe"\""


I converted it over to the proper 7-zip SFX format and it gives 0 errors, but doesn't work:

;!@Install@!UTF-8!
OverwriteMode="1"
RunProgram="hidcon:cmd /c \"%APPDATA%\\WhileIdle\\WhileIdle.exe\""
RunProgram="hidcon:cmd /c \"reg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v Whileidle /t REG_SZ /d \"\"%APPDATA%\\WhileIdle\\WhileIdle.exe\"\"\""
InstallPath="%APPDATA%\\WhileIdle"
GUIMode="2"
;!@InstallEnd@!


Thanks

This post has been edited by skEwb: 19 July 2011 - 03:34 PM


Share this topic:


  • 22 Pages +
  • « First
  • 12
  • 13
  • 14
  • 15
  • 16
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

6 User(s) are reading this topic
0 members, 6 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy