Jump to content











Photo
- - - - -

Dynamic Shortcuts


Best Answer niveknonrev , 06 November 2013 - 07:00 PM

The files are on the ISO, not in the WIM so the copy operation is working just fine.

So the only issue is that the Add_shortcut won't actually add any for these EXE's

 

the source dir is controlled by pFileBox1 where I can point to where I downloaded my portable apps.

 

I SOLVED my problem though doesn't seem like I should have to do it this way.

Here is the solution to create a shortcut to any file that is NOT in the Programs directory:

You MUST specify Y:\ as the root of the EXE file path.

 

This finally worked just like I wanted it to:

Add_Shortcut,StartMenu,PortableApps,y:\PortableApps\%AppName%\%AppName%.exe,%AppName%

 

I guess the Add_Shortcut function has some built in processes that won't allow automatic relative paths etc.

%targetdir% didn't work in the path either.

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 niveknonrev

niveknonrev
  • Members
  • 8 posts

Posted 06 November 2013 - 04:06 PM

I am trying to add shortcuts to the start menu at build time - seems easy enough.

But obviously I am doing something wrong.

 

I have a directory full of portable apps each in their own sub directory.

I made a script that will find all the exe files in there, and put their names an INI file.

Simple enough - it works and I even kick it off from Winbuilder 082 in my Win7PE project

the INI gets created perfectly

So far so good

 

Then I use a loop to run through all the entries in the INI file and create shortcuts in the start menu

BUT it is not working

Here is what I have right now:

 

//Copy apps to root of the target drive

DirMake,%TargetDir%\PortableApps
DirCopy,%SourceDir%,%TargetDir%

 

//run my custom script to create INI file
ShellExecute,Open,%ScriptDir%\GetExeNames.cmd,"#$q%Sourcedir%#$q #$q%ScriptDir%#$q"
IniRead,%ScriptDir%\PortApps.ini,TotalApps,TotalApps,%TotalApps%
//Echo,I got %TotalApps% Apps

 

//run loop to add shortcuts depending on how many apps were found
Loop,%ScriptFile%,AddShortcuts,1,%TotalApps%

 

[AddShortcuts]

//read INI and add the shortcut to the EXE file
IniRead,%ScriptDir%\PortApps.ini,Apps,AppName#c,%AppName%
Add_Shortcut,StartMenu,PortableApps,PortableApps\%AppName%\%AppName%.exe,%AppName%

 

Nothing shows up in the start menu

The files are on the root of the drive - just no shortcuts

 

What did I mess up?

 



#2 pscEx

pscEx

    Platinum Member

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

Posted 06 November 2013 - 04:47 PM

Please post also the contents of the generated ini file.

 

Peter



#3 niveknonrev

niveknonrev
  • Members
  • 8 posts

Posted 06 November 2013 - 04:52 PM

Here is the INI file after generation:

The folder names and the EXE names are the same

[TotalApps]
TotalApps=17
[Apps]
AppName1=7-ZipPortable
AppName2=FileAlyzerPortable
AppName3=HDHackerPortable
AppName4=HWiNFOPortable
AppName5=KasperskyTDSSKillerPortable
AppName6=McAfeeStingerPortable
AppName7=ProcessExplorerPortable
AppName8=SpybotPortable
AppName9=UltraDefragPortable
AppName10=WindowsErrorLookupToolPortable
AppName11=WinMergePortable
AppName12=WinSCPPortable
AppName13=WiseDataRecoveryPortable
AppName14=WiseDiskCleanerPortable
AppName15=WiseProgramUninstallerPortable
AppName16=WiseRegistryCleanerPortable
AppName17=ZSoftUninstallerPortable



#4 pscEx

pscEx

    Platinum Member

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

Posted 06 November 2013 - 05:20 PM

The files are on the root of the drive - just no shortcuts

 

I'm not sure about the contents of %SourceDir%.

 

Has it the subdir PortableApps with subdirs for every app?

 

If not, maybe you should use:

 

DirCopy,%SourceDir%,%TargetDir%\PortableApps

 

Peter



#5 niveknonrev

niveknonrev
  • Members
  • 8 posts

Posted 06 November 2013 - 07:00 PM   Best Answer

The files are on the ISO, not in the WIM so the copy operation is working just fine.

So the only issue is that the Add_shortcut won't actually add any for these EXE's

 

the source dir is controlled by pFileBox1 where I can point to where I downloaded my portable apps.

 

I SOLVED my problem though doesn't seem like I should have to do it this way.

Here is the solution to create a shortcut to any file that is NOT in the Programs directory:

You MUST specify Y:\ as the root of the EXE file path.

 

This finally worked just like I wanted it to:

Add_Shortcut,StartMenu,PortableApps,y:\PortableApps\%AppName%\%AppName%.exe,%AppName%

 

I guess the Add_Shortcut function has some built in processes that won't allow automatic relative paths etc.

%targetdir% didn't work in the path either.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users