Jump to content

getting a winrar SFX to make an accurate shortcut to .exe in user-defi


Recommended Posts

I have a winrar SFX that prompts the user for a directory(this part i didn't want unattended) Is there a way to send a shortcut to an .exe to the desktop, so no matter what directory the user specifies, he/she will receive a desktop shortcut to this program on the desktop?

I was hoping to have a batch file make shortcut.exe be able to recognize the directory of the executable, and create a fullpath to it, but that doesn't seem to be working.

Edited by shapeless
Link to comment
Share on other sites

  • 4 years later...

please read this

Shortcut=<DestType>,<SrcName>,<DestFolder>,<Description>,<ShortcutName>,<ShortcutIcon>

Create a shortcut to unpacked file.

DestType is one character wide field, which can have the following values:

D Create a shortcut on Desktop
S Create a shortcut in Start Menu
P Create a shortcut in Start Menu/Programs
T Create a shortcut in Startup folder



SrcName is a name of archived file.

DestFolder is a folder to create a shortcut in. If it does not exist, it will be created by SFX archive.

Description is a text string describing a shortcut.

ShortcutName is a name of .lnk (shortcut) file created by SFX.

ShortcutIcon is a name of icon file associated with shortcut. If you omit this parameter, the default icon will be used. If icon file name does not contain the full path, SFX archive will search the icon file in folder containing unpacked files.

All parameters are separated by commas. If you need to put a comma character inside of parameter, enclose the whole parameter to quotes. Repeat quotes twice if you need to insert a quote mark into string. Only DestType and SrcName are required, other parameters are optional.
Example

Create a shortcut in folder WinRAR on Desktop to archived file winrar.exe with the description "WinRAR executable file", name "WinRAR archiver" and icon winrar.ico:

Shortcut=D, winrar.exe, WinRAR, "WinRAR executable file", "WinRAR archiver", winrar.ico

Edited by hessam
Link to comment
Share on other sites

  • 4 months later...

I have tried this method a lot of times it creates the shortcut on desktop but do not find the real place of shortcut program :(

You have nothing showed special in this picture but thanks it won't work.

Link to comment
Share on other sites

  • 1 month later...

Hello, i have come across this thread, and this for quite a whille.

I managed to make it create Desktop Icons Successfully.

There is only just a small thing that wont do.

So, it is adding the target successfully, but it ads no target ! :(

How it currently is:

Target: "D:\Folder1\Folder2\Run Game.exe"

Start in:

How it should be:

Target: "D:\Folder1\Folder2\Run Game.exe"

Start in: "D:\Folder1\Folder2"

This is my shortcut code:

Shortcut=D, "System\Run Game.exe", "", "Run Game in Win7", "Launch Game",  

Please help me out to specify the shortcut "Start in". I hope someone is able to help me, and i havent registered for nothing :(

Edited by TheKiller
Link to comment
Share on other sites

Hello, i have come across this thread, and this for quite a whille.

I managed to make it create Desktop Icons Successfully.

There is only just a small thing that wont do.

So, it is adding the target successfully, but it ads no target ! :(

How it currently is:

Target: "D:\Folder1\Folder2\Run Game.exe"

Start in:

How it should be:

Target: "D:\Folder1\Folder2\Run Game.exe"

Start in: "D:\Folder1\Folder2"

This is my shortcut code:

Shortcut=D, "System\Run Game.exe", "", "Run Game in Win7", "Launch Game",  

Please help me out to specify the shortcut "Start in". I hope someone is able to help me, and i havent registered for nothing :(

Hi Thekiller

Try this...

I copied out calc.exe and rename to Run Game.exe, then WinRAR SFX it according to your given path.

Config/comment file I use works fine on my XP.

;The comment below contains SFX script commands

Path=D:\Folder1\Folder2
SavePath
Silent=1
Overwrite=1

Shortcut=D, "Run Game.exe", "", "Run Game in Win7", "Launch Game", ""

Edited by Geej
Link to comment
Share on other sites

Hi Geej, thank you for your answer.

Please bear with me till i fix this issue :)

I have done what you told me to. I Added Silent=1 after savepath in the omment box, and added the commas at the end, but it doesnt do any difference.

This is my entire script :


;The comment below contains SFX script commands

Path=%PROGRAMFILES%\Folder1\Folder2\
SavePath
Silent=1
Overwrite=1
Title=Unrealed Patch for Vista/7
Text
{
This will allow you to Run the Editor and the Game in Windows Vista/7.
}
Shortcut=D, "System\Run Game.exe", "", "Run Game in Win7", "Launch Game",
Shortcut=D, "System\Run Editor.exe", "", "Run Editor in Win7", "Launch Editor",
Shortcut=P, "System\Run Game.exe", "Unrealed Patch for Vista7", "Run Game in Win7", "Launch Game",
Shortcut=P, "System\Run Editor.exe", "Unrealed Patch for Vista7", "Run Editor in Win7", "Launch Editor",
Shortcut=P, "System\Uninstall Vista7 Patch.bat", "Unrealed Patch for Vista7", "Uninstall Vista7 Patch", "Uninstall Vista7 Patch",

Edited by TheKiller
Link to comment
Share on other sites

  • 1 month later...

Hello, i have come across this thread, and this for quite a whille.

I managed to make it create Desktop Icons Successfully.

There is only just a small thing that wont do.

So, it is adding the target successfully, but it ads no target ! :(

How it currently is:

Target: "D:\Folder1\Folder2\Run Game.exe"

Start in:

How it should be:

Target: "D:\Folder1\Folder2\Run Game.exe"

Start in: "D:\Folder1\Folder2"

This is my shortcut code:

Shortcut=D, "System\Run Game.exe", "", "Run Game in Win7", "Launch Game",  

Please help me out to specify the shortcut "Start in". I hope someone is able to help me, and i havent registered for nothing :(

This was my question as well. I was just messing around to see if I could get it to work, and here's how you set the start in to the installation path the user chooses.


D, your.exe, \, "Shortcut Description", "Shortcut name",

Hope this helps... this is not clear at all for SFX users.

Link to comment
Share on other sites

  • 9 months later...

Thanks own3mall. That's an invaluable tip. Just one little "\" is all that's needed.

The WinRAR documentation for the very tricky shortcut command line is completely deficient.

Also, problematic, is the failure in the SFX UI to make any distinction between design-time settings and runtime settings.

Edited by michaelmross
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...