Jump to content











Photo
* * * * * 1 votes

Shortcut issues


  • Please log in to reply
26 replies to this topic

#1 pscEx

pscEx

    Platinum Member

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

Posted 19 August 2009 - 04:17 PM

In several topics, mainly in 'AppScripts' several tasks are running due to shortcuts.

Generally: It is NOT a WinBuilder issue, because WinBuilder does not even know that shortcuts exist, and therefore does not work with them.
WinBuilder only executes code coming from scripts, which handles shortcuts.

For the nativeEx world (nativeEx_barebone, NaughtyPE, nativePE, LiveXP, ...) I wrote the package 'BuildModel' which handles shortcuts.

In my opinion ....
There exists an API interface, which gets as input more easier commands than BuildModel needs and wraps to
  • nativeEx world
  • Vista / Win7 world
The issues currently occurring (here only for the nativeEx world) are possibly either
  • caused by the host OS, because it does not generate shortcuts in the 'currently known' way
  • caused by the API because it does not generate the suited calls to BuildModel
  • imaginary problems because the user assumes something, which cannot be done neither by the API nor by BuildModel
The 'BuildModel' package works well.

Restriction: On my systems German XP SP3, German Vista 64 bit, English Win7 RC1

In order to be sure, I ask all members to do shortcut tests on their systems and report, when there are issues.

For that I uploaded a special nativeEx minimized version having only one Test.Script app.

This script generates:
  • ShowDesktop.scf
  • a *.bat file
  • a *.cmd file
  • a *.scr file
With shortcuts in QL, DE, SM
All of them in the BuildModel call do not define any icon.
On my 3 systems all icons are displayed well, and the corresponding commands are executed correctly.

Please
  • Download the test project from the nativeEx server
  • Unzip into any directrory (preferrable WITH spaces in the path)
  • Start WinBuilder
  • Define the path to your source CD and build
    (Factory setting is 'Emulate in VirtualBox', if you do not have VirtualBox, you can choose between qEmu and VMWare)
  • Test the PE
If there are any issues, please report here.

Download URL: http://nativeex.boot...ShortcutTest.7z

Peter

#2 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 19 August 2009 - 05:40 PM

All work fine.
With german and english XPSP2 as source.

:whistling:

#3 pscEx

pscEx

    Platinum Member

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

Posted 19 August 2009 - 07:55 PM

All work fine.
With german and english XPSP2 as source.

:cheers:


Thanks, MedEvil, but I'm surprised.

I remember anywhere in the back of my head, that either Lancelot or Pedrole15 mention "MedEvil's issue". And that started the crazy API 'debug rebuild' with the current result that an API does hardcoded decisions :whistling: . Can you explain what happened?

Peter

#4 pscEx

pscEx

    Platinum Member

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

Posted 19 August 2009 - 08:05 PM

All work fine.
With german and english XPSP2 as source.

:whistling:

And -as I remember- with host XP SP1?

Peter

#5 fxscrpt

fxscrpt

    Frequent Member

  • .script developer
  • 328 posts
  •  
    Germany

Posted 19 August 2009 - 08:42 PM

Peter
:whistling:

all icons are ok for xp sp2/sp3 (ger+enu) on xp x64 sp2.

Peter

#6 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 19 August 2009 - 09:01 PM

Yep host XPSP1.
And the issue was, back then, with API generated shortcuts only.
Using the buildmodel directly worked fine.

The only way around the problem, that i found, aside from rewriting all API scripts in NaughtyPE, was to let the API explicitly write the iconfile into the shortcut, even if the script did not demand it.

And the so called Problem, we're having now, is not a problem, imo.
- Creating a shortcut to a shortcut is nonsense anyway. Period.
- A shortcut to a *.bat -,*.cmd- or *.au3 Loader, should always have a icon different from it's own specified. Preferably the one from the exe, it's suppose to load.

:whistling:

#7 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 20 August 2009 - 05:35 AM

@MedEvil

as far as i know, Common Api 10 with default settings do not make hardcoded decisions , am i missing sth ?

#8 pscEx

pscEx

    Platinum Member

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

Posted 20 August 2009 - 10:29 AM

@Medevil:

Please show him this line in the API
StrFormat,SPLIT,"##$pSystemRoot##$p\System32\shell32.dll##$c071|##$pSystemRoot##$p\System32\shell32.dll##$c071|#3",|,%Case%,%Case%
And tell him that I never spoke about some possible settings.

Peter :whistling:

#9 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 20 August 2009 - 10:43 AM

as far as i know, Common Api 10 with default settings do not make hardcoded decisions , am i missing sth ?

I havn't tested or read through API 10 yet.

:whistling:

#10 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 20 August 2009 - 02:18 PM

@psc

If you read apps topic carelfully, hardcoded lines which is connected to option (which is not selected default) added for Medevil's request. Issues discussed was Medevil's pm request (common api 8) (reason written by MedEvil) causing some shortcut icon creation problems (.cmd, .scf.....) and lines added by pedrole to aid (Medevil) when option selected.

As a result all should be happy with having an option on common api script (I like options), Currently LiveXP do not use that option (and no hardcoded lines processed) which result fine here. What you like is not having hardcoded process like me and you should be happy with common api 10 with default settings too. MedEvil maybe happy by selecting the option (maybe or not, waiting MedEvil to test or read capi 10).


I haven't tested or read through API 10 yet.

I guess time to test :whistling: . I may fail or miss to explain things on current post, if that happens I hope you can.

#11 pscEx

pscEx

    Platinum Member

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

Posted 20 August 2009 - 03:22 PM

Looks like we begin to speak same language again. :whistling:
It is good that in the 'standard situation' there is no hardcoded stuff.

But my opinion exceeds that.
IMHO the API is a STUPID (inspite ingenious programmed) interface which only has to wrap / translate etc. info from one world into the other world.
And therefore also in 'special' conditions there should be no hardcoded stuff in the API.

Imagine, a translator in a discussion between Obama and Medvedev would insert his opinion into the translation ... :)

Mainly @Pedro: I think, instead of coding inside the API, a way similar to that one I already suggested should be used:

The Project defines something like
%.ext%=#$p???#$c???
EDIT: Not to be misunderstood: %.ext% maybe .cmd, .bat, .au3 or whatelse ...
And the API uses this info if provided
StrFormat,ext,#3,%_Ext%

Set,%Icon%,#$p%_Ext%#$p

StrFormat,REPLACE,%Icon%,#$p_Ext#$p,"#3",%Icon%

Run,%API%,???,#1,#2,#3,#4,#5,#6,%Icon%,#8,#9

That holds the API 'stupid' and fills #7 with an icon if the project wants.

Peter

#12 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 20 August 2009 - 09:34 PM

Ok Peter
But code should for me (in Common_Api 10):
[ShcMode_1]

StrFormat,ext,#3,%_Ext%

If,ExistVar,#$p%_Ext%#$p,begin

Set,%Icon%,#$p%_Ext%#$p

StrFormat,REPLACE,%Icon%,#$p_Ext#$p,"#3",%Icon%

Run,%API%,ShortcutIcon,#1,#2,#3,#4,#5,#6,%Icon%,#8,#9

End

Else,Run,%API%,IsOnCD,#1,#2,#3,#4,#5,#6,"#$q#$s#$q-SF:#3#$q#$s#$q-SI:0",#8,#9


#13 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 20 August 2009 - 10:06 PM

Yep host XPSP1.
And the issue was, back then, with API generated shortcuts only.
Using the buildmodel directly worked fine.

So I think the big problem of API is how is passed variable to BuildModel
When you want pass to BuidModel #spVariable#$p in reality it's %Variable% that it's passed
Same problem for quote #$q
Hope you uderstand what I mean (@psc and @MedEvil)

#14 pscEx

pscEx

    Platinum Member

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

Posted 21 August 2009 - 06:58 AM

Ok Peter
But code should for me (in Common_Api 10):

[ShcMode_1]

 StrFormat,ext,#3,%_Ext%

 If,ExistVar,#$p%_Ext%#$p,begin

 Set,%Icon%,#$p%_Ext%#$p

 StrFormat,REPLACE,%Icon%,#$p_Ext#$p,"#3",%Icon%

 Run,%API%,ShortcutIcon,#1,#2,#3,#4,#5,#6,%Icon%,#8,#9

 End

 Else,Run,%API%,IsOnCD,#1,#2,#3,#4,#5,#6,"#$q#$s#$q-SF:#3#$q#$s#$q-SI:0",#8,#9

:)
How it is expressed is unimportant.
Important is that the 'shell32.del' disappeared.

Peter

#15 pscEx

pscEx

    Platinum Member

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

Posted 21 August 2009 - 07:21 AM

So I think the big problem of API is how is passed variable to BuildModel
When you want pass to BuidModel #spVariable#$p in reality it's %Variable% that it's passed
Same problem for quote #$q
Hope you uderstand what I mean (@psc and @MedEvil)

The mechanism is easy.
Passing #1 from 'Run' to 'Run', does not change #1.
Set,%Var%,#1 does not decrease the #-count.
Assigning a 'multi-#' variable to a parameter of a 'Run' decreases the #-count.
EDIT: To avoid this, put an additional '#' in front of the variable.
EDIT: Changed code and picture to demonstrate this

[process]

Run,%ScriptFile%,level_1,###$qblabla###$q,###$qHello World###$q,##$qNoChange##$q



[level_1]

Set,%b%,#2

Set,%c%,#3

Run,%ScriptFile%,level_2,#1,%b%,#%c%



[level_2]

Set,%b%,#2

Set,%c%,#3

Run,%ScriptFile%,level_3,#1,%b%,#%c%



[level_3]

levels.gif

Peter

#16 pscEx

pscEx

    Platinum Member

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

Posted 21 August 2009 - 03:43 PM

When testing several constallations, inside the shortcutWinExp.exe (the program generating shortcuts from the intermediate file), I found some strange constructions, being there since the ICE-Age.
Maybe that is the root for several 'icons missing by voodoo'.

When writing the app, I have had similar ideas like currently is tried to do by API:

When the icon file is not defined, use the .exe itself.

ok, but what when there is e.g. a .cmd which has no icon? ????

I built a new shortcutWinExp.exe.

Members who want to test, please attach it to your explorer.script.
When testing, please make sure that 'Do not refresh shortcuts on ISO boot' in BuildModel.script is checked.
(If it is unchecked, shortcuts are refreshed and ok for 99.9 %)
And when testing, use an API version / switch, which does not define the icon file when the parameter is empty.

Sorry for my historic fault and the inconvenience!

Peter

Attached File  shortcutWinExp.zip   85.61KB   367 downloads

#17 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 22 August 2009 - 03:46 AM

with your instructions, I tested .cmd and .exe file creations by using xpsp2enu source.

when folder have no space:
shortcuts icon created successfully with both current and new shortcutWinExp.exe, and shortcuts working fine.

when folder have space:
shortcuts icon created unsuccessfully with both current and new shortcutWinExp.exe
also shortcuts do not work (when left clicked no "Open" selection exists)
ps: unchecking 'Do not refresh shortcuts on ISO boot' in BuildModel.script solves both problem.

test script with xpsp2enu source,
http://lancelot.winb...cuts_psc.script

#18 pscEx

pscEx

    Platinum Member

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

Posted 22 August 2009 - 10:47 AM

when folder have space:
shortcuts icon created unsuccessfully with both current and new shortcutWinExp.exe

Thanks Lancelot!

I can reproduce with my testshortcut script and English source, that means without API.

I think this will be fixed in 5 (Latin) minutes.

Peter

#19 pscEx

pscEx

    Platinum Member

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

Posted 22 August 2009 - 05:29 PM

I think this will be fixed in 5 (Latin) minutes.

I have been too optimistic :)

Better would be 5 (Latin) years :)

Facts:

Currently there is only one way to create shortcuts, namely using Billy the Door's IShellLink interface.
This interface has one 'small' requirement: In order to create the shortcut correctly, the target must be physically at the location, where the link points to.

I already did a lot
  • Whenever possible, use %SystemDrive% rather than 'X:'
  • If necessary, SUBST the X: drive
  • If necessary, copy the target to the necessary location
  • Create the path on your local host
  • Copy the target there
  • Create the *.lnk
  • RollBack everything
But there is still an issue which I cannot solve right now:
When I do the 'ghost stuff' and copy e.g. in my German system with 'Programme' to the temporarily created 'Program files', the shortcut is created.

But: It anywhere contains the Short Name 'Program~2' rather then 'Program Files'

Creative developers now may suggest:
Just replace it by 'Program~1'. In the PE there is only one folder starting with Program ...

That has been my opinion, too and I tried.

But: The program's short name in my booted ISO is 'Program~5' :cheers:

I give up!

It seems to be not possible to generate a shortcut on system A which can be copied into System B and works there w/o adjustements.

For adjustement long time ago I wrote an small app, which runs through the PE's file tree and 'Resolves' (Billy the Dooor's function) all shortcuts.

When anybody here has something, maybe a (Windows) script generating shortcuts for an 'unknown' target, please, post.

As an alternity, I suggest:

Remove the 'Resolve' option from Buildmodel.Script and put it (mandatory and not choosable for the user) into Explorer.script.

This causes the 'ok' situation Lancelot reported:

ps: unchecking 'Do not refresh shortcuts on ISO boot' in BuildModel.script solves both problem.



Peter

#20 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 22 August 2009 - 06:36 PM

You already have my code.
As long as there is a variable used in the strings which exists :), it works flawless.
Did you had any trouble with it, in XPSP2?

:)

#21 pscEx

pscEx

    Platinum Member

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

Posted 22 August 2009 - 06:51 PM

You already have my code.
As long as there is a variable used in the strings which exists :) , it works flawless.
Did you had any trouble with it, in XPSP2?

:)

MedEvil, You are trying to kid me! :cheers:

I remembered (and that is the reason I wrote 'maybe a (Windows) script') that you posted a VBS (?) many month (years?) ago.

But please do not let me search it in the backups. Please repost!

Peter :cheers:

#22 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 22 August 2009 - 07:12 PM

I've send it to you just 2 weeks ago, by PM.
You've said, that it does the same your program does, just by using WSHAPI instead of WinApi, but the results still weren't the same.
Remember?

:)

#23 pscEx

pscEx

    Platinum Member

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

Posted 22 August 2009 - 07:14 PM

I've send it to you just 2 weeks ago, by PM.
You've said, that it does the same your program does, just by using WSHAPI instead of WinApi, but the results still weren't the same.
Remember?

:)

Thanks, I'll have a look at the PM.
(I hope it is still existant, I often delete older PMs to be in my limit)

Peter

EDIT: 2 weeks ago I have around 30 or more PMs by you. Sorry, I do not want to search.

Maybe you have the solution and do not post here. And we have to live with the 'Resolve' workaround.

Peter

#24 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 22 August 2009 - 08:42 PM

Before you're starting to cry. :)

Here it is.Attached File  CS2.rar   1.61KB   358 downloads

btw. You have a week to miss me, effective imediately i'm on vacation. :)


:cheers:

#25 pscEx

pscEx

    Platinum Member

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

Posted 23 August 2009 - 08:57 AM

Here the result with MedEvil's VBScript.
medevil_shortcut.gif
No difference to what I described in post #19

Peter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users