Jump to content











Photo
- - - - -

shortcut - another query


  • Please log in to reply
21 replies to this topic

#1 llamedoso

llamedoso

    Member

  • Members
  • 31 posts

Posted 21 July 2007 - 11:50 AM

I have created a script using makescript for an old 16bit chess program that I like. The chess.exe needs a supporting file called opening.bk to be in the same folder as the .exe. This was no problem, added this to the script OK.
When I run WB the following happens, there is a shortcut on the desktop - CHESS - when I click on that I get the message " Cannot find opening.bk" program then program continues.
If I exit program and go to where chess.exe is located and create another shortcut and drag this new shortcut to the desktop and click on it then the chess program starts (obviously it found the opening.bk file) if I exit the program and then right click on the 2 shortcuts and go to properties I get the following:

Original WB shortcut:

Target:rmdrive%\Program Files\programs\chess.exe
Start In: This box is empty!

The new shortcut:

Target:"X:\Program Files\programs\chess.exe
Start In:"X:\Program Files\Programs

Any explanation?

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10549 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 21 July 2007 - 12:00 PM

Yes, you need to specify the work directory otherwise it will try to run the exe from the desktop folder instead of the program where the other file is found.

Look inside the BuildModel script - it contains a lot of switches that you can use..

:yahoo:

#3 pscEx

pscEx

    Platinum Member

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

Posted 21 July 2007 - 12:10 PM

Original WB shortcut:

Target:rmdrive%\Program Files\programs\chess.exe
Start In: This box is empty!

The new shortcut:

Target:"X:\Program Files\programs\chess.exe
Start In:"X:\Program Files\Programs

nativeEx based projects refresh shortcuts on boot, using 'resShort.exe'
You can switch this behaviour off by checking 'Do not refresh shortcuts on ISO boot' in buildModel.Script.

As a result, maybe you do not see the app's icon.

Peter

#4 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 21 July 2007 - 12:31 PM

@psc
Would your refresh program, add informations into the shortcut like the target folder?

:yahoo:

#5 pscEx

pscEx

    Platinum Member

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

Posted 21 July 2007 - 12:45 PM

@psc
Would your refresh program, add informations into the shortcut like the target folder?

:yahoo:

I do not know how Bill G. handles this code:
if FileExists(actFile) then

	 begin

	   linkTarget := WideString(actFile);

	   PFile.Load(PWideChar(linkTarget), 2);

	   Writeln(Output, 'Resolving Shortcut ' + actFile);

	   SLink := PFile as IShellLink;

	   SLink.Resolve(0, SLR_NO_UI or SLR_UPDATE);

	   PFile := SLink as IPersistFile;

	   PFile.Save(PWideChar(linkTarget), false);

	 end;

Peter

#6 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 21 July 2007 - 01:33 PM

Sorry, ment will your program also add the 'Ausführen in' setting when not specified originaly, or will it just try to clean things up?

:yahoo:

#7 pscEx

pscEx

    Platinum Member

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

Posted 21 July 2007 - 01:45 PM

Sorry, ment will your program also add the 'Ausführen in' setting when not specified originaly, or will it just try to clean things up?

:)

I understood your question.
But <IShellLink>.LinkResolve is an API call which rebuilds the link.
I do not know and cannot influence the rules of this call. :yahoo:

Peter

#8 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 21 July 2007 - 02:46 PM

Ahh, i see. Just thought you must have tested it sometime.

:yahoo:

#9 pscEx

pscEx

    Platinum Member

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

Posted 21 July 2007 - 02:56 PM

Ahh, i see. Just thought you must have tested it sometime.

:yahoo:

Just a personal response to MedEvil:
Alter Nörgler! :)

Peter

#10 llamedoso

llamedoso

    Member

  • Members
  • 31 posts

Posted 21 July 2007 - 05:22 PM

nativeEx based projects refresh shortcuts on boot, using 'resShort.exe'
You can switch this behaviour off by checking 'Do not refresh shortcuts on ISO boot' in buildModel.Script.

As a result, maybe you do not see the app's icon.

Peter


Thanks, tried above still doesn't work. I'm struggling here, can't understand the other replies!

#11 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10549 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 21 July 2007 - 05:58 PM

It's not a shortcut issue - I think you just need to specify the work dir.. :yahoo:


Try to adapt this as needed:

Run,%BuildModelScript%,Add-Shortcut,&#34;DE&#34;,&#34;#$qX&#58;\Program Files\programs\chess.exe#$q&#34;,&#34;Chess&#34;,&#34;-SW&#58;#$qX&#58;\Program Files\programs\#$q&#34;


Haven't tested and I'm using fixed paths, but I really recommend you to read the help page inside buildmodel.

I can also create a new script if you wish - just post the game on a new topic.

:)

#12 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 21 July 2007 - 06:24 PM

Just a personal response to MedEvil:
Alter Nörgler! :yahoo:

Peter

:)
Sorry completely forgot, you don't test your software! :)

:)

#13 llamedoso

llamedoso

    Member

  • Members
  • 31 posts

Posted 22 July 2007 - 06:43 PM

Thanks, tried above still doesn't work. I'm struggling here, can't understand the other replies!


Have found solution. the attached shortcut.script file does it all, makes windows shortcuts, same as XP. These shortcuts are 1kb long as against the 2kb for WB shortcuts.
Have attached shortcut.script and the chess program as sample of use. Seems better method than existing WB method?

Attached Files



#14 llamedoso

llamedoso

    Member

  • Members
  • 31 posts

Posted 22 July 2007 - 06:51 PM

Have found solution. the attached shortcut.script file does it all, makes windows shortcuts, same as XP. These shortcuts are 1kb long as against the 2kb for WB shortcuts.
Have attached shortcut.script and the chess program as sample of use. Seems better method than existing WB method?


What's wrong here? This 3rd attempt to upload shortcut.script.

Attached Files



#15 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10549 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 23 July 2007 - 12:51 PM

Hi llamedoso!

Created a new script using API commands, looks much simpler now and will work with other projects as well.

Only need to use this as header:

&#91;main&#93;

Title=Chess

Description=The board game

Selected=True

Level=5

Version=1

Author=David Norris

Date=2007-JUL-23



&#91;variables&#93;

%ProgramTitle%=Chess

%ProgramEXE%=CHESS.EXE

%ProgramFolder%=Chess



&#91;process&#93;

Add_Shortcut,StartMenu,Games

unpack

And change the "chess" foldername to "folder" (or download the script) from here.

Enjoy your game! :yahoo:

#16 pscEx

pscEx

    Platinum Member

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

Posted 23 July 2007 - 04:31 PM

Have found solution. the attached shortcut.script file does it all, makes windows shortcuts, same as XP. These shortcuts are 1kb long as against the 2kb for WB shortcuts.
Have attached shortcut.script and the chess program as sample of use. Seems better method than existing WB method?

Your chess script contains the line

Run,%AutoRunScript%,Add,shortcut.exe /F:"b:\documents and settings\default user\desktop\chess.lnk"
/A:c /T:"x:\program files\chess\chess.exe" /W:"x:\program files\chess"

The shortcut will only work on your or other English systems.
If I build a German PE, I have
B:\documents and settings > R:\Dokumente und Einstellungen
program files > Programme.

That is the reason that I created buildModel

BTW: hardcoded drive names is not good!
You should prefer to use %systemdrive%

Peter

#17 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10549 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 23 July 2007 - 04:41 PM

It was already corrected on the script I've posted - look on the api based script - under livexp it will call buildmodel with the correct values and also start the program on the respective folder where it find the missing files.

:yahoo:

#18 llamedoso

llamedoso

    Member

  • Members
  • 31 posts

Posted 25 July 2007 - 10:48 AM

Hi llamedoso!

Created a new script using API commands, looks much simpler now and will work with other projects as well.

Only need to use this as header:

&#91;main&#93;

Title=Chess

Description=The board game

Selected=True

Level=5

Version=1

Author=David Norris

Date=2007-JUL-23



&#91;variables&#93;

%ProgramTitle%=Chess

%ProgramEXE%=CHESS.EXE

%ProgramFolder%=Chess



&#91;process&#93;

Add_Shortcut,StartMenu,Games

unpack

And change the "chess" foldername to "folder" (or download the script) from here.

Enjoy your game! :yahoo:


Hi Nuno,
Yes this looks much better than my shortcut method - BUT one snag I tried it and it doesn't work! No errors reported in log. But I'm using NativePE maybe this is problem?

#19 llamedoso

llamedoso

    Member

  • Members
  • 31 posts

Posted 25 July 2007 - 11:04 AM

Your chess script contains the line

The shortcut will only work on your or other English systems.
If I build a German PE, I have
B:\documents and settings > R:\Dokumente und Einstellungen
program files > Programme.

That is the reason that I created buildModel

BTW: hardcoded drive names is not good!
You should prefer to use %systemdrive%

Peter


Hi Peter,
I take your point, never thought of other languages! I get confused with variables like %systemdrive% etc. find it easier and less typing to to use hard coding. My WB builds use fixed drive names, i.e X and B for the ram drive, and stuff my own programs use is always in C drive.
Find programming fascinating but somewhat confusing. Guess I'm not too bright! Took me a day to figure out the following problem:-
WB build worked as expected on my Desktop PC but when I transferred iso to Sony laptop found that using keyboard on laptop I got the following when using keyboard...
qwerty456
asdfgh123
zxcvbn0
Simple answer, needed to 'Switch Numlock' to OFF in build
!!
Like I said - not too bright

#20 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10549 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 25 July 2007 - 12:06 PM

Hi llamedoso!

Yes, this is still under testing and development and should become publicly available really soon.

Add the newer liveXP web server on your wb download center: livexp.boot-land.net

This API is already applied over liveXP, porting to nativeEx and other projects should also be simple but will take a little more time until we can finish debug and testing things - but makes life simpler, doesn't it? :yahoo:

#21 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 25 July 2007 - 01:18 PM

Add the newer liveXP web server on your wb download center: livexp.boot-land.net

Are those the same files as from unattended.boot-land.net?

:yahoo:

#22 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10549 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 25 July 2007 - 01:24 PM

I'll be moving newer livexp scripts to livexp.boot-land.net - already finished up most coding and now I'll be converting the scripts that were still livexp/nativeEx specific (not difficult, just takes a while to get done..)

:yahoo:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users