Jump to content











Photo
- - - - -

(SOLVED!)I cannot add FOLDERS as attachment


  • Please log in to reply
21 replies to this topic

#1 st-dv

st-dv

    Frequent Member

  • Members
  • 121 posts
  •  
    Germany

Posted 05 February 2008 - 05:47 AM

hello,

in the past (with Version 072a) I created a shortcut for a portable app like f.e. HDTUNE with the following script:
I think in Version 074 there is a new way I read in the forum, but I didn't find out what to do.
So how do I create a Shortcut at Desktop, Startmenu-Programs.... and Quicklaunch with the new Version 074 ???

If somebody could help me.. that would be great... thanks...


[Main]
Title=HD Tune
Author=Joshuatree
Level=5
Version=
Description=HD Tune
Locked=false
Selected=True

[Main]
...
Selected=True

[Variables]
%Executable%=HDTune.exe
%OutDir%=HDtune
%PName%=HD Tune
%ParentItem%=Disk Tools

[Process]
Echo,Processing %PName%...
If,%pCheckBox1%,Equal,true,SET,"%DestDir%","Program#$sFiles\%OutDir%"
If,%pCheckBox1%,Equal,false,SET,"%DestDir%","Programs\%OutDir%"
If,%pCheckBox1%,Equal,true,SET,"%LinkDir%","x:\Program#$sFiles\%OutDir%"
If,%pCheckBox1%,Equal,false,SET,"%LinkDir%","y:\%OutDir%"
System,RefreshVars
DirMake,"%TargetDir%\%DestDir%"
FileCopy,"%ScriptDir%\*.*","%TargetDir%\%DestDir%"
TXTAddLine,%ES%,"%LinkDir%\%Executable%,%ParentItem%\%PName%.lnk,%LinkDir%","Append"

[Interface]
pCheckBox1="Run from ram (boot.wim)",1,3,11,96,200,18,False

#2 st-dv

st-dv

    Frequent Member

  • Members
  • 121 posts
  •  
    Germany

Posted 05 February 2008 - 08:23 AM

Ok, sorry......

I just saw that NUNO answered to another post of mine...

But I got still one problem:

In the case of adding a portable app as an attachement I can not add a FOLDER... only FILES... is it possible to add folders in the attachement, because some of my portable apps have folders and subfolders....

#3 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 05 February 2008 - 09:48 AM

Ok, sorry......

I just saw that NUNO answered to another post of mine...

But I got still one problem:

In the case of adding a portable app as an attachement I can not add a FOLDER... only FILES... is it possible to add folders in the attachement, because some of my portable apps have folders and subfolders....


7z the folder structure into one file which can be attached.
After extracting the 7z, extract it to the original folder structure.

Peter

#4 st-dv

st-dv

    Frequent Member

  • Members
  • 121 posts
  •  
    Germany

Posted 05 February 2008 - 09:55 AM

Hello Peter,

Danke sehr... hätte ich auch selbst drauf kommen können...

thanks a lot....

#5 st-dv

st-dv

    Frequent Member

  • Members
  • 121 posts
  •  
    Germany

Posted 05 February 2008 - 10:46 AM

I still got one problem with it....

I can attach the 7zip-File.... but how to extract it?

Sorry... I don't see it..... it is not that I make "extract to" scriptfolder... or?

#6 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 05 February 2008 - 11:10 AM

I still got one problem with it....

I can attach the 7zip-File.... but how to extract it?

Sorry... I don't see it..... it is not that I make "extract to" scriptfolder... or?


Sample, as I do with the folder %TargetDir%\$Modelram (containing Documents and Settings):
compress:
ShellExecute,Hide,"%Tools%\7za.exe","a -t7z -sfx #$q%TargetDir%\ModelRam.exe#$q -r #$q%TargetDir%\$ModelRam\*#$q -aoa -mmt -mx9"
Expand to Ram drive:
RegWrite,"HKLM",0x1,"WB-Software\Microsoft\Windows\CurrentVersion\RunOnceEx\999","998","CMD /C #$qModelRam -o%RAMDriveLetter%#$q&pause"
hiderun instead of cmd also possible.

Peter

#7 st-dv

st-dv

    Frequent Member

  • Members
  • 121 posts
  •  
    Germany

Posted 05 February 2008 - 11:17 AM

That is tooooooooo high.......

I am using a script like this: f.e. it is the VLC-Portable 0.86d....... the Portable-app has several subfolders... thats why I can't add it without using 7zip, is it right?
But what do I have to do after packing the 7-zip-Package?

[main]
Title=Sudoku
Description=The popular number game
Level=5

[variables]
%ProgramTitle%=Sudoku
%ProgramEXE%=sudoku.exe
%ProgramFolder%=Sudoku

[process]
Add_Shortcut,Desktop
Add_Shortcut,AutoStart
Add_Shortcut,StartMenu,Games and Fun
unpack

#8 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 05 February 2008 - 11:35 AM

That is tooooooooo high.......

I am using a script like this: f.e. it is the VLC-Portable 0.86d....... the Portable-app has several subfolders... thats why I can't add it without using 7zip, is it right?
But what do I have to do after packing the 7-zip-Package?

[main]
...

[process]
Add_Shortcut,Desktop
Add_Shortcut,AutoStart
Add_Shortcut,StartMenu,Games and Fun
unpack


unpack is here wrong, because the API unpack function writes the zipped file as application into the target.

here you have to:
  • ExtractFile,"%ScriptFile%","Folder",<ZIP>,<tempdir>
  • ShellExecute,Hide,%tools%\7za,"x <tempdir>\<ZIP> -o<output dir> *.* -r
Please understand that i wrote the 7z syntax 'on the fly'. You have to check it.

Peter

BTW: <output dir> must be the full path to the variable %ProgramFolder%!
Of course you can use other variables like %baseDir% or %targetDir%

#9 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 05 February 2008 - 01:23 PM

Just to make it complete for the other forum's members:

By PM (using German language) we exchanged a couple of other information.

As a result: In this special case, because the app is installed on the local PC, just a DirCopy is possible.

Peter

#10 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 05 February 2008 - 02:18 PM

...

But what do I have to do after packing the 7-zip-Package?

[main]
Title=Sudoku
Description=The popular number game
Level=5

[variables]
%ProgramTitle%=Sudoku
%ProgramEXE%=sudoku.exe
%ProgramFolder%=Sudoku

[process]
Add_Shortcut,Desktop
Add_Shortcut,AutoStart
Add_Shortcut,StartMenu,Games and Fun
unpack,folder,sudoku.zip,true


(added)

You need to specify the archive. The archive will be unpacked and unzipped to the Program's Folder.

Attached (as soon as that damned Internal Server Error subsides) is Nuno's Application Script, modified for demonstartion, so that the files attached to the Script (sudoku.exe and license.txt) are replaced by a single .zip archive of the files.

[attachment=4297:log.html]
[attachment=4296:Sudoku.Script.script]

#11 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 05 February 2008 - 02:26 PM

(added)

You need to specify the archive. The archive will be unpacked and unzipped to the Program's Folder.

Attached (as soon as that damned Internal Server Error subsides) is Nuno's Application Script, modified for demonstartion, so that the files attached to the Script (sudoku.exe and license.txt) are replaced by a single .zip archive of the files.

[attachment=4297:log.html]
[attachment=4296:Sudoku.Script.script]

Thanks, allanf, for your post! :thumbsup:

I did not know the enhanced unpack syntax yet!

Peter

#12 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 05 February 2008 - 02:33 PM

Thanks, allanf, for your post! :thumbsup:

I did not know the enhanced unpack syntax yet!

Peter


Maybe only VistaPE? http://www.vistape.n...pe-api.html#api

You are right that 'unpack' by itself will only copy the zipped archive to the target.

#13 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 05 February 2008 - 02:39 PM

Maybe only VistaPE? http://www.vistape.n...pe-api.html#api

You are right that 'unpack' by itself will only copy the zipped archive to the target.

It is also valid for natieEx based projects.
Comment inside API.Script:
unpack,#1,#2,#3

#1=AnotherFolder

#2=Archive.7z,zip,rar

#3=True or False &#40;default True&#41; for delete Folder where is unziped the Archive before copying them to the Target

Peter

#14 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 05 February 2008 - 02:56 PM

...

#2=Archive.7z,zip,rar

... and '.exe's? I haven't tried it, but it seems that VistaPE's api will attempt to execute an exe if it is not the same as %ProgramExe%.

If,%Depack_Ext%,Equal,&#34;.exe&#34;,run,%API%,Depack_Execute_Archive,#1,#2,#3,#4,#5,#6

...

&#91;Depack_Execute_Archive&#93;

Echo,&#34;Executing acrhive file...&#34;

ShellExecute,open,&#34;#4\#5\#2&#34;,&#34;#3&#34;,&#34;#4\#5&#34;


#15 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 05 February 2008 - 03:00 PM

...

 #2=Archive.7z,zip,rar

... and '.exe's? I haven't tried it, but it seems that VistaPE's api will attempt to execute an exe if it is not the same as %ProgramExe%.

If,%Depack_Ext%,Equal,&#34;.exe&#34;,run,%API%,Depack_Execute_Archive,#1,#2,#3,#4,#5,#6

 ...

 &#91;Depack_Execute_Archive&#93;

 Echo,&#34;Executing acrhive file...&#34;

 ShellExecute,open,&#34;#4\#5\#2&#34;,&#34;#3&#34;,&#34;#4\#5&#34;


Maybe that is a question for our API experts:

@pedrole ???
@galapo ???

Peter

#16 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 05 February 2008 - 07:15 PM

[main]
Title=Sudoku
Description=The popular number game
Level=5

[variables]
%ProgramTitle%=Sudoku
%ProgramEXE%=sudoku.exe
%ProgramFolder%=Sudoku

[process]
Add_Shortcut,Desktop
Add_Shortcut,AutoStart
Add_Shortcut,StartMenu,Games and Fun
unpack


OK, compress the program into a 7z file, say Sudoku.7z. Encode in the script into a folder with the name Sudoku.

Then:

&#91;main&#93;

Title=Sudoku

Description=The popular number game

Level=5



&#91;variables&#93;

%ProgramTitle%=Sudoku

%ProgramEXE%=sudoku.exe

%ProgramFolder%=Sudoku



&#91;process&#93;

Add_Shortcut,Desktop

Add_Shortcut,AutoStart

Add_Shortcut,StartMenu,Games and Fun

unpack,Sudoku,Sudoku.7z,True

Regards,
Galapo.

#17 st-dv

st-dv

    Frequent Member

  • Members
  • 121 posts
  •  
    Germany

Posted 06 February 2008 - 07:33 AM

Hello,


very very much thanks to all of you..... it worked... with with syntax:

[main]
Title=VLC Player
Description=
Level=5
Selected=True
Depend=%basedir%Projects\

[variables]
%ProgramTitle%=VLC Player
%ProgramEXE%=VLCPortable.exe
%ProgramFolder%=VLC Player

[process]
Add_Shortcut,Desktop
Add_Shortcut,StartMenu,Media
unpack,Folder,VLC.zip,true



Great work from all of you.... !!!

#18 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 06 February 2008 - 08:14 AM

Hwo to use unpack:
Unpack,[Folder],[Archive],[False],[%Target_Prog%],[%ProgramFolder%],[%programExe%]

[Folder] :
if it is not specified, it is set to default value : Folder
(it is the name of the folder that you have in the tabs "Attachments" when you edit your script under Winbuilder)

[Archive] :
You specify the name of the Archive but ONLY IF IT IS AN ARCHIVE , enter nothing if you have encoded the files directly with Winbuider
If it is an .exe (sfx) it is extracted on %Target_Prog%,executed and deleted
see "partition_find_and_mount.script"
If it is not an .exe , should be a .7z .zip or rar, it is extracted to a temp folder and copied to %Target_Prog%

[True/False]
True for delete the archive after extraction for archive .7z .zip or rar, (Default value in changed now for livexp to True so it is not necceray to specify it)
for archive .exe you give here the parameters for silent install (see "partition_find_and_mount.script")

[%Target_Prog%] [%ProgramFolder%] [%programExe%] :
you use this only if you want to extract to a different folder as default or have a second folder to extract

param4,param5 and param6 are required only if they are different of default value
If param2 is not specified param6 is not required even if it is different of %programExe%

Example:
Unpack,ExpEnvVar,,True,%Target_Prog%,ExpEnvVar,ExpEnvVar.exe
==>can be simply
Unpack,ExpEnvVar,,,,ExpEnvVar


#19 Augusto

Augusto

    Newbie

  • Members
  • 17 posts
  •  
    Dominican Republic

Posted 23 June 2008 - 04:59 PM

Hey guys sorry to be re-opening some old post but..!!! about this syntax for unpack
I want to unpack some files to Windows\System32 and the only code i have found to work is
Unpack,Files,system32.7z,True,%TargetDir%\windows\,system32
Why ? i dont know i have tried lots of variants and nothing ever worked... is that the right way? O_o

#20 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 23 June 2008 - 05:19 PM

Hey guys sorry to be re-opening some old post but..!!! about this syntax for unpack
I want to unpack some files to Windows\System32 and the only code i have found to work is

Unpack,Files,system32.7z,True,%TargetDir%\windows\,system32
Why ? i dont know i have tried lots of variants and nothing ever worked... is that the right way? O_o

This will extract the contents of system32.7z (attached to your script under 'Files' ) to %TargetDir%\windows.
Is the comma in front of system32 intended or a typo.
If it is intended the evauated part of the statement ends at this comma. If it is a typo, the files will be extended into ...\system32.

If you want to have a different result, please tell us which one.

BTW: There is also the 'Conventional' method:
  • ExtractFile,%ScriptFile%,Files,system32.7z,<temp path of your choice> (must exist!)
  • ShellExecute,Hide,%Tools%\7za,"e -o%TargetDir%\windows\system32 <temp path of your
    choice>\system32.7z" (no guarantee that the 7z syntax is correct :) )
Peter

#21 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 23 June 2008 - 07:08 PM

Hey guys sorry to be re-opening some old post but..!!! about this syntax for unpack
I want to unpack some files to Windows\System32 and the only code i have found to work is

Unpack,Files,system32.7z,True,%TargetDir%\windows\,system32
Why ? i dont know i have tried lots of variants and nothing ever worked... is that the right way? O_o


Please see here

Peter

#22 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 23 June 2008 - 07:28 PM

Hey guys sorry to be re-opening some old post but..!!! about this syntax for unpack
I want to unpack some files to Windows\System32 and the only code i have found to work is

Unpack,Files,system32.7z,True,%TargetDir%\windows\,system32
Why ? i dont know i have tried lots of variants and nothing ever worked... is that the right way? O_o

Syntax==> Unpack,[Folder],[Archive],[Option],[%Target_Prog%],[%ProgramFolder%],[%programExe%]
Unpack,Files,system32.7z,True,%Target_Win%,system32
or you can use a .
Unpack,Files,system32.7z,True,%Target_Sys%,.

The last parameter [%programExe%] is not directly use by Unpack but by CopyProgram
Before unpacking the archive there is a test (Only for archive .7z .zip or .rar)
If,ExistFile,&#34;%ScriptDir%\#5#6&#34;,Run,%API%,Copy_Program,&#34;%ScriptDir%\#5&#34;,&#34;#4#5&#34;,&#34;#6&#34;,,#8
That mean if exist "%ScriptDir%\[%ProgramFolder%]\[%programExe%]" ,files are copied from there, rather exctract from the script

:)
Pedro




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users