Jump to content











Photo
- - - - -

Creating shortcuts using interface


  • Please log in to reply
17 replies to this topic

#1 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 08 June 2007 - 11:06 AM

Hi

when building this script i get shortcuts pointing to wrong place someone please tell me what's wrong ?

example
this line
f,%pDECheckBox%,Equal,True,Run,%BuildModelScript%,Add-Shortcut,"DE","#$pSystemDrive#$p\%pScrollBox1%","%pTitleTextBox%"
will produce shortcust pointing to
X:\Program_\Rename+\Rename+.exe

[Main]

Title=Rename+

Type=Script

Selected=True



[Process]

Echo,Copying files  (Program Files Node) Build[(None)]...

If,NotExistDir,"%TargetDir%\Program Files\Rename+",DirMake,"%TargetDir%\Program Files\Rename+"

FileCopy,"%ScriptDir%\Program Files\Rename+\Rename+.exe","%TargetDir%\Program Files\Rename+\"



[Process]

Echo,Creating shortcuts through interface ...

IniRead,"%ProjectInfo%","TargetStrings","sProgram_Files","%Programs%"

If,%pDECheckBox%,Equal,True,Run,%BuildModelScript%,Add-Shortcut,"DE","#$pSystemDrive#$p\%pScrollBox1%","%pTitleTextBox%"

If,%pQLCheckBox%,Equal,True,Run,%BuildModelScript%,Add-Shortcut,"QL","#$pSystemDrive#$p\%pScrollBox1%","%pTitleTextBox%"

If,%pSMCheckBox%,Equal,True,Run,%BuildModelScript%,Add-Shortcut,"SM","#$pSystemDrive#$p\%pScrollBox1%","%pTitleTextBox%"



[Interface]

pDECheckBox=Desktop,1,3,156,64,60,18,True

pSMCheckBox=Startmenu,1,3,303,64,69,18,False

pQLCheckBox=Quicklaunch,1,3,222,64,78,18,False

pTitleTextBox="Display name",1,0,153,31,213,21,Rename+

pScrollBox1=%Programs%\Rename+\Rename+.exe,1,4,81,91,366,21,%Programs%\Rename+\Rename+.exe,%Programs%\Rename+\Uninstall.exe

pBevel1=pBevel1,1,12,8,9,492,111

pTextLabel1="Create Shortcuts ?",1,1,22,32,113,18,8,Bold

pTextLabel2="This will apply to only one item",1,1,374,20,78,44,8,Normal


#2 pscEx

pscEx

    Platinum Member

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

Posted 08 June 2007 - 11:08 AM

Please post the log.

Peter

Edited by smiley, 08 June 2007 - 11:13 AM.
Remove huge quote


#3 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 08 June 2007 - 11:16 AM

Log file & script

#4 pscEx

pscEx

    Platinum Member

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

Posted 08 June 2007 - 11:19 AM

Log file

Your %Programs% is empty!
Try a System,RefreshVars behind the IniReade line.

Peter

#5 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 08 June 2007 - 11:49 AM

Hi

Thanks peter

Before posting that topic i tried to build "Retrieve Project Info" then build my script but i get the same results empty variable and wrong shortcut target (i thought that this script will evaluate Program_Files)

now

after adding System,RefreshVars and running the script >> same problem

there's what i've done
build the whole LiveXp project with these script's selected
LiveXp\Basic\!WBManager\*
LiveXp\Basic\Build\* (without copy and expand script)

this time i got non empty %Programs% variable pointing to "Program Files"

but shortcut target pointing to "X:\Program_\Rename+\Rename+.exe"

* WBverify crashed during build

Log file

Thanks

#6 pscEx

pscEx

    Platinum Member

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

Posted 08 June 2007 - 11:53 AM

Looks like a buildModel issue.
Please give me some time to check.

To check the Verify, I need the fundamentals script with actual options.

BTW: You should uncheck myOptions and WBVerify.

Peter

Edited by smiley, 08 June 2007 - 12:03 PM.
Remove huge quote


#7 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 08 June 2007 - 12:04 PM

it seams that this problem is related to short and long file name's issue Program_ (8 characters)

maybe i'm missing some quote marks some where around file paths ?

!Fundamentals included

#8 pscEx

pscEx

    Platinum Member

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

Posted 08 June 2007 - 12:06 PM

@h7se!

You have VERY old scripts!

The buildModel you use has version 012.
To Compare, the current versions are:
LiveXP: 028
NativePE: 034
nativeEX_barebone: 035

Please do an update before further tests.

Peter

#9 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 08 June 2007 - 12:22 PM

i made an update for Basic and Build script's this time can't see any (Default User) under $ModelRAM
just resShort.exe

maybe you can download the script and see if it works for you ?

thanks

#10 pscEx

pscEx

    Platinum Member

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

Posted 08 June 2007 - 12:38 PM

i made an update for Basic and Build script's this time can't see any (Default User) under $ModelRAM

The (Default User) path is created, when the first shortcut inside is created.

Suggestion: Try the same with a fresh download of nativeEX_barebone.
This is EXACTLY what I have on my PC

Peter

#11 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 08 June 2007 - 01:51 PM

here's the problem solution

DirMake,"%TargetDir%\$ModelRAM\Default User\Desktop"
DirMake,"%TargetDir%\$ModelRAM\Default User\Start Menu\Programs"

maybe the script which create shortcut's should check each time if these dir's exist or not

and create it when needed not only when building the entire project

#12 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10547 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 08 June 2007 - 02:31 PM

Congratulations! :thumbup:

But isn't the path mean to be localized under your own language? :1st:

In my case it would show "Programas" instead of "Programs" so you might need to read the correct value for each source..

Have you used an english source?

:thumbup:

#13 pscEx

pscEx

    Platinum Member

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

Posted 08 June 2007 - 03:00 PM

here's the problem solution

DirMake,"%TargetDir%\$ModelRAM\Default User\Desktop"
DirMake,"%TargetDir%\$ModelRAM\Default User\Start Menu\Programs"

maybe the script which create shortcut's should check each time if these dir's exist or not

and create it when needed not only when building the entire project


There truely is a different root of the issue.
Usually you can start a project w/o $ModelRAM and w/o creating any sub directory inside.
Whenever this directory or childs are accessed for the first time, they are created internally in the buildModel.exe program.

We have to find out, what is different at your system.

As I already suggested in my last post: Please try a BRANDNEW nativeEx_barebone.
If that does not work, too, we have to find the difference of your host system.
If that does work we have to find the difference between your NativePE / LiveXP and your nativeEx_barebone projects.

Believe me, in troubles of programs made by me, I usally look for the mistake at my own work.
But currently I do not have enough arguments to find anything wrong.

Peter

#14 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 08 June 2007 - 04:04 PM

But isn't the path mean to be localized under your own language? :1st:

In my case it would show "Programas" instead of "Programs" so you might need to read the correct value for each source..

if you mean this line
DirMake,"%TargetDir%\$ModelRAM\Default User\Start Menu\Programs"
then buildModel script should take care of that, i just grabed it from my system as an example

Have you used an english source?

Yes

@Peter

i'll do more test about that and let you know but for now i get some line's in my log maybe you want to see
Processing section: [Add-Shortcut]From file: [%BaseDir%\Projects\LiveXP\Basic\Build\4 - buildModel.Script]

AddVariables - File [C:\Documentos\Projectos Delphi\Project - 2006 - WinBuilder\WinBuilder071\Projects\LiveXP\Basic\Shells\Explorer.Script] was not found!
IF - Directory exists: [%BaseDir%\Projects\LiveXP\Temp\Shortcuts] evaluated string: [If,NotExistDir,%ProjectDir%\Temp\Shortcuts,DirMake,%ProjectDir%\Temp\Shortcuts]
AddVariables - Added section [Variables] from file [%BaseDir%\Projects\LiveXP\Basic\Build\4 - buildModel.Script] into the local variable list
IF - File does not exist: [%BaseDir%\Projects\LiveXP\Temp\buildModel_err.log] evaluated string: [If,ExistFile,"%ProjectDir%\Temp\buildModel_err.log",FileDelete,"%ProjectDir%\Temp\buildModel_err.log"]
IF - File exists: [%BaseDir%\Projects\LiveXP\Temp\shortcutParse.exe] evaluated string: [If,NotExistFile,%ProjectDir%\Temp\shortcutParse.exe,ExtractFile,"%BuildModelScript%","Folder","shortcutParse.exe",%ProjectDir%\Temp]
IF - [sm] is not equal to: [1] evaluated string: [If,#1,Equal,1,ShellExecute,Hide,#$q%ProjectDir%\Temp\shortcutParse.exe#$q,"#$q/C:%ProjectInfo%#$q #$q/O:%shcTemp%#$q #$q/A:#1#$c#2#$q"]
IF [sm] is equal to: [1]
Shellexecute: [Hide] using: ["%BaseDir%\Projects\LiveXP\Temp\shortcutParse.exe"] with parameters: ["/C:%BaseDir%\Projects\LiveXP\ProjectInfo.ini" "/O:%BaseDir%\Projects\LiveXP\Temp\shcTemp.ini" "/ST:SM" "/SE:%SystemDrive%\Program Files\Go2Target\Uninstall.exe" "/SL:Go2Target" ""]
IniRead - [%BaseDir%\Projects\LiveXP\Temp\shcTemp.ini] Section [Created] key [Date] to variable: [%tim%] with value [2007-Jun-08 155135187]
IniRead - [%BaseDir%\Projects\LiveXP\Temp\shcTemp.ini] Section [Shortcut] key [shortCutName] to variable: [%nam%] with value [Go2Target]
FileCopy - Copied [%BaseDir%\Projects\LiveXP\Temp\shcTemp.ini] to: [%BaseDir%\Projects\LiveXP\Temp\Shortcuts\Go2Target_2007-Jun-08#$s155135187.shc\]
Run - Failed to find section [Add-Shortcut] in file: [C:\Documentos\Projectos Delphi\Project - 2006 - WinBuilder\WinBuilder071\Projects\LiveXP\Basic\Shells\Explorer.Script] IF - File does not exist: [%BaseDir%\Projects\LiveXP\Temp\buildModel_err.log] evaluated string: [If,ExistFile,"%ProjectDir%\Temp\buildModel_err.log",ShellExecute,Open,"%ProjectDir%\Temp\buildModel_err.log",""]

#15 pscEx

pscEx

    Platinum Member

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

Posted 08 June 2007 - 04:12 PM

if you mean this line
DirMake,"%TargetDir%\$ModelRAM\Default User\Start Menu\Programs"
then buildModel script should take care of that, i just grabed it from my system as an example


Yes

@Peter

i'll do more test about that and let you know but for now i get some line's in my log maybe you want to see
Processing section: [Add-Shortcut]From file: [%BaseDir%\Projects\LiveXP\Basic\Build\4 - buildModel.Script]

AddVariables - File [C:\Documentos\Projectos Delphi\Project - 2006 - WinBuilder\WinBuilder071\Projects\LiveXP\Basic\Shells\Explorer.Script] was not found!
IF - Directory exists: [%BaseDir%\Projects\LiveXP\Temp\Shortcuts] evaluated string: [If,NotExistDir,%ProjectDir%\Temp\Shortcuts,DirMake,%ProjectDir%\Temp\Shortcuts]
AddVariables - Added section [Variables] from file [%BaseDir%\Projects\LiveXP\Basic\Build\4 - buildModel.Script] into the local variable list
IF - File does not exist: [%BaseDir%\Projects\LiveXP\Temp\buildModel_err.log] evaluated string: [If,ExistFile,"%ProjectDir%\Temp\buildModel_err.log",FileDelete,"%ProjectDir%\Temp\buildModel_err.log"]
IF - File exists: [%BaseDir%\Projects\LiveXP\Temp\shortcutParse.exe] evaluated string: [If,NotExistFile,%ProjectDir%\Temp\shortcutParse.exe,ExtractFile,"%BuildModelScript%","Folder","shortcutParse.exe",%ProjectDir%\Temp]
IF - [sm] is not equal to: [1] evaluated string: [If,#1,Equal,1,ShellExecute,Hide,#$q%ProjectDir%\Temp\shortcutParse.exe#$q,"#$q/C:%ProjectInfo%#$q #$q/O:%shcTemp%#$q #$q/A:#1#$c#2#$q"]
IF [sm] is equal to: [1]
Shellexecute: [Hide] using: ["%BaseDir%\Projects\LiveXP\Temp\shortcutParse.exe"] with parameters: ["/C:%BaseDir%\Projects\LiveXP\ProjectInfo.ini" "/O:%BaseDir%\Projects\LiveXP\Temp\shcTemp.ini" "/ST:SM" "/SE:%SystemDrive%\Program Files\Go2Target\Uninstall.exe" "/SL:Go2Target" ""]
IniRead - [%BaseDir%\Projects\LiveXP\Temp\shcTemp.ini] Section [Created] key [Date] to variable: [%tim%] with value [2007-Jun-08 155135187]
IniRead - [%BaseDir%\Projects\LiveXP\Temp\shcTemp.ini] Section [Shortcut] key [shortCutName] to variable: [%nam%] with value [Go2Target]
FileCopy - Copied [%BaseDir%\Projects\LiveXP\Temp\shcTemp.ini] to: [%BaseDir%\Projects\LiveXP\Temp\Shortcuts\Go2Target_2007-Jun-08#$s155135187.shc\]
Run - Failed to find section [Add-Shortcut] in file: [C:\Documentos\Projectos Delphi\Project - 2006 - WinBuilder\WinBuilder071\Projects\LiveXP\Basic\Shells\Explorer.Script] IF - File does not exist: [%BaseDir%\Projects\LiveXP\Temp\buildModel_err.log] evaluated string: [If,ExistFile,"%ProjectDir%\Temp\buildModel_err.log",ShellExecute,Open,"%ProjectDir%\Temp\buildModel_err.log",""]


Your explorer.script section [Add-Shortcut] is called from buildModel, but it does not exist because you have an incompatible version of explorer.script.
A second reason maybe that the variable %ActiveShell% in script.project has the wrong contents
This looks more propably for me, because here seems to be a remainder of Nuno's system.
%ActiveShell% is written from Explorer.script; here again a hint to an incompatible version.

Again, please:
Try a fresh nativeEx_barebone.

Peter

#16 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 08 June 2007 - 07:54 PM

Yes Peter it works fine now .. Thanks

but @Nuno see what problem

the first section will show you tow message's

[Process]
Message,"0 (message box appear)",Information
Echo,Creating shortcuts...
Message,"1 (message box appear)",Information


the second will show you the first messagebox but when processing Echo command it will exit the section to the next one and skip all command's after this Echo command and the reason is the extra word "[Native]"

[Process]
Message,"2 (message box appear)",Information
Echo,Creating shortcuts...[Native]
Message,"3 (No message box appear)",Information

#17 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 08 June 2007 - 09:14 PM

Ok i get it ...

WinBuilder treat the [Native] inside the echo statment as a begining of new section called Native
but should it do that ?

in this case the syntax for Echo command in the wiki should be changed to Echo,"Message"

Echo,Creating shortcuts...[Native]

#18 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10547 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 08 June 2007 - 10:00 PM

This is an unexpected behavior, but thanks to your code example I've reproduced the erratic behavior and the next beta will have it corrected (should be available tomorrow)..

Good luck with the rest of your codings! :1st:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users