(SOLVED!)I cannot add FOLDERS as attachment
#1
Posted 05 February 2008 - 05:47 AM
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
Posted 05 February 2008 - 08:23 AM
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
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
Posted 05 February 2008 - 09:55 AM
Danke sehr... hätte ich auch selbst drauf kommen können...
thanks a lot....
#5
Posted 05 February 2008 - 10:46 AM
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
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
Posted 05 February 2008 - 11:17 AM
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
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
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
Posted 05 February 2008 - 01:23 PM
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
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
Posted 05 February 2008 - 02:26 PM
Thanks, allanf, for your post!(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]
I did not know the enhanced unpack syntax yet!
Peter
#12
Posted 05 February 2008 - 02:33 PM
Thanks, allanf, for your post!
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
Posted 05 February 2008 - 02:39 PM
It is also valid for natieEx based projects.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.
Comment inside API.Script:
unpack,#1,#2,#3 #1=AnotherFolder #2=Archive.7z,zip,rar #3=True or False (default True) for delete Folder where is unziped the Archive before copying them to the Target
Peter
#14
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,".exe",run,%API%,Depack_Execute_Archive,#1,#2,#3,#4,#5,#6 ... [Depack_Execute_Archive] Echo,"Executing acrhive file..." ShellExecute,open,"#4\#5\#2","#3","#4\#5"
#15
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,".exe",run,%API%,Depack_Execute_Archive,#1,#2,#3,#4,#5,#6 ... [Depack_Execute_Archive] Echo,"Executing acrhive file..." ShellExecute,open,"#4\#5\#2","#3","#4\#5"
Maybe that is a question for our API experts:
@pedrole ???
@galapo ???
Peter
#16
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:
[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,Sudoku,Sudoku.7z,True
Regards,
Galapo.
#17
Posted 06 February 2008 - 07:33 AM
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
Posted 06 February 2008 - 08:14 AM
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
[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
Posted 23 June 2008 - 04:59 PM
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\,system32Why ? i dont know i have tried lots of variants and nothing ever worked... is that the right way? O_o
#20
Posted 23 June 2008 - 05:19 PM
This will extract the contents of system32.7z (attached to your script under 'Files' ) to %TargetDir%\windows.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 isUnpack,Files,system32.7z,True,%TargetDir%\windows\,system32Why ? i dont know i have tried lots of variants and nothing ever worked... is that the right way? O_o
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 )
#21
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 isUnpack,Files,system32.7z,True,%TargetDir%\windows\,system32Why ? 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
Posted 23 June 2008 - 07:28 PM
Syntax==> Unpack,[Folder],[Archive],[Option],[%Target_Prog%],[%ProgramFolder%],[%programExe%]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 isUnpack,Files,system32.7z,True,%TargetDir%\windows\,system32Why ? i dont know i have tried lots of variants and nothing ever worked... is that the right way? O_o
Unpack,Files,system32.7z,True,%Target_Win%,system32or 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,"%ScriptDir%\#5#6",Run,%API%,Copy_Program,"%ScriptDir%\#5","#4#5","#6",,#8That 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