Jump to content

Add Custom Shortcut to Unattended Install


 Share

Recommended Posts

:blushing: Maybe I’m just a dummy but I can’t get a custom icon or shortcut to show up in the Administrator or all users desktop to install a program. I have read till my eyes are bloodshot. I’m not the sharpest color in the box, so please keep it simple. Any help would be deeply appreciated.

Thanks in advance. :hello:

Link to comment
Share on other sites


I need details to the path and name of the program executable, also the desired Shortcut name, and info tip...

Example:

Path: C:\Program Files\Program Folder\executable.exe

Shortcut Name: Install This

Info Tip: Install this on first boot

Edited by ricktendo64
Link to comment
Share on other sites

Path: AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

Shortcut Name: NOD32 Install

Info Tip: Install this on first boot

how i do it

with WINRAR [you must have winrar installed for this way] :

1. create the shorcut on desktop named NOD32 Install

for your AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

2. copy this shortcut in AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\ folder [needed part]

3. right click the shortcut placed in AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\ folder

choose add to archive

4. check create sfx archive and create solid archive and compression method=best

name the archive what you want, but remember is an .exe now . i will say here installnod32.exe

5. go to tab files

on files to add, delete [DEL] the file there [will be install.bat not the shortcut to install.bat]

click append... and choose your shortcut .

press ok.

now you will have a SFX rar archive [an exe file] who contain your shortcut.

6. during your XP install place this SFX on desktop [there are tens methods for that]

7. when you will execute the installnod32.exe , will extract on the desktop your shortcut.

if you want to do this silent [without asking you]

before press ok , in winrar , go to comment tab and

write in enter a comment manually window

Silent=1
Overwrite=1

if you want to run automatically [when you execute your installnod32.exe] the shortcut

this means execute your AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

add there in comment tab

Setup="NOD32 Install.lnk"

or maybe i do not understand what you want ?

Link to comment
Share on other sites

Path: AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

Shortcut Name: NOD32 Install

Info Tip: Install this on first boot

how i do it

with WINRAR [you must have winrar installed for this way] :

1. create the shorcut on desktop named NOD32 Install

for your AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

2. copy this shortcut in AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\ folder [needed part]

3. right click the shortcut placed in AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\ folder

choose add to archive

4. check create sfx archive and create solid archive and compression method=best

name the archive what you want, but remember is an .exe now . i will say here installnod32.exe

5. go to tab files

on files to add, delete [DEL] the file there [will be install.bat not the shortcut to install.bat]

click append... and choose your shortcut .

press ok.

now you will have a SFX rar archive [an exe file] who contain your shortcut.

6. during your XP install place this SFX on desktop [there are tens methods for that]

7. when you will execute the installnod32.exe , will extract on the desktop your shortcut.n

if you want to do this silent [without asking you]

before press ok , in winrar , go to comment tab and

write in enter a comment manually window

Silent=1
Overwrite=1

if you want to run automatically [when you execute your installnod32.exe] the shortcut

this means execute your AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

add there in comment tab

Setup="NOD32 Install.lnk"

or maybe i do not understand what you want ?

The part about hot to have this icon in Administrators and\or all users Desktop after the unattedd install is what I’m missing?

Link to comment
Share on other sites

Path: AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

Shortcut Name: NOD32 Install

Info Tip: Install this on first boot

how i do it

with WINRAR [you must have winrar installed for this way] :

1. create the shorcut on desktop named NOD32 Install

for your AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

2. copy this shortcut in AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\ folder [needed part]

3. right click the shortcut placed in AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\ folder

choose add to archive

4. check create sfx archive and create solid archive and compression method=best

name the archive what you want, but remember is an .exe now . i will say here installnod32.exe

5. go to tab files

on files to add, delete [DEL] the file there [will be install.bat not the shortcut to install.bat]

click append... and choose your shortcut .

press ok.

now you will have a SFX rar archive [an exe file] who contain your shortcut.

6. during your XP install place this SFX on desktop [there are tens methods for that]

7. when you will execute the installnod32.exe , will extract on the desktop your shortcut.n

if you want to do this silent [without asking you]

before press ok , in winrar , go to comment tab and

write in enter a comment manually window

Silent=1
Overwrite=1

if you want to run automatically [when you execute your installnod32.exe] the shortcut

this means execute your AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

add there in comment tab

Setup="NOD32 Install.lnk"

or maybe i do not understand what you want ?

The part about hot to have this icon in Administrators and\or all users Desktop after the unattedd install is what I’m missing?

Link to comment
Share on other sites

I need details to the path and name of the program executable, also the desired Shortcut name, and info tip...

Example:

Path: C:\Program Files\Program Folder\executable.exe

Shortcut Name: Install This

Info Tip: Install this on first boot

ricktendo64

Not shure what u meen by (Info Tip)

Link to comment
Share on other sites

There are many ways to create a shortcut from a batch file. You could simply create the shortcut in the same folder and copy it to the desktop. Just remember that the shortcut has a .lnk extension. From the batch file run the following

copy /y "%~dp0My Shortcut.lnk" "%ALLUSERSPROFILE%\Desktop"

Another option is to use shortcut.exe. Copy shortcut.exe to the same folder as your batch file and call it using "%~dp0shortcut.exe" or change to directory "%~dp0" or copy shortcut.exe to the System32 folder under your windows directory.

"%~dp0shortcut.exe" /F:"%ALLUSERSPROFILE%\Desktop\Notepad.lnk" /A:C /T:"C:\WINNT\system32\notepad.exe"

note the above must be run from a patch file so "%~dp0" will expand to the path where the batchfile is located. If running from the command line specive the path to shortcut.exe or copy it to youe system32 folder.

Use %USERPROFILE% from the administrator account in place of %ALLUSERSPROFILE% to create the icon on the current users desktop.

Edited by FrankE9999
Link to comment
Share on other sites

Path: AIO-DVD\SETUP\XP\Professional\$OEM$\$1\Nod32\install.bat

Shortcut Name: NOD32 Install

Info Tip: Install this on first boot

Here is what I would do.

According to the above, you are copying a folder called Nod32 to the %SystemDrive% usually c:\

I would move install.bat to

AIO-DVD\SETUP\XP\Professional\$OEM$\$Docs\All Users\Desktop\Install.bat

This will achieve exactly what you want, assuming the contents of your install.bat looks similar to this

@echo off
%SystemDrive%\Nod32\setup.exe

or

@echo off
cd \Nod32
setup

The custom icon will be a little tougher. Because you are using a batch file, there are no resources attached to it. You have to create an executable and then change the icon. That is a little more involved. Try the above, it will get you the shortcut on the desktop for all users.

If you really want the icon, you will need RAR or 7z and create an switchless installer. Then use Resource Hacker to change the icon.

Edited by Gee
Link to comment
Share on other sites

The best way to create a Custom Shortcut during an Unattended

Install (HINT: Try reading the title :) ) is to create an inf file as shown

below and 'install' it using the following command.

"rundll32 setupapi,InstallHinfSection DefaultInstall 128 .\<filename>.inf"

This creates two shortcuts, one in the specified start menu folder and another

on the desktop. Which particular locations will depend on precisely when the inf

file is 'installed'.

If the file is 'installed' from cmdlines.txt they will be created in the Default

User directory and subsequently inherited by any account created afterwards

including Administrator.

If the file is 'installed' from RunOnceEx they will only be created in the

Administrator directory during the first logon.

To use the code shown below simply replace the <...> sections with the

appropriate names and locations etc. These will use the default icon from

the executable file. It is possible to override this to specified a particular

icon but this would complicate things and you did wish it to be kept simple.

:)

BTW: Wouldn't it be easier to run your installation directly from RunOnceEx ?


[Version]
Signature = "$Windows NT$"

[DefaultInstall]
ProfileItems = StartMenuSC, DesktopSC

[StartMenuSC]
Name = "<product name>"
CmdLine = 16422,"<program directory>",<executable filename>
SubDir = "<start menu folder>"

[DesktopSC]
Name = "<product name>"
CmdLine = 16422,"<program directory>",<executable filename>
SubDir = "..\..\Desktop"

Link to comment
Share on other sites

I am under the impression that he does not want the application installed unattended. But to allow the user to install it as they wish.

Link to comment
Share on other sites

I am under the impression that he does not want the application installed unattended. But to allow the user to install it as they wish.

That's certainly how I read his request. I just wondered why he chose this rather

than the alternative.

Link to comment
Share on other sites

Y :blink: es you are correct; the reason I ask for it this way is because NOD32 wouldn’t load my confg file at T-12 automatically without asking for more info. But if I loaded it after a complete install it would, and it would automatically start the update download. I would like to install it with a RunOnceEx command but I can’t seem to get it to work.

Thanks again for the info :thumbup

Link to comment
Share on other sites

Have you thought of trying a VBS Script to make the shortcut on The AllUserDesktop.

This will make a Shortcut on The AlllUserDesktop to Notepad.

Save As SC_AllUserDeskTop.vbs

 Const ALL_USERS_DESKTOP = &H19&
Dim Shell :Set Shell = CreateObject("Shell.Application")
Dim Act :Set Act = CreateObject("Wscript.Shell")
Dim AllUDesk, Folder, FolderItem, Link
Set Folder = Shell.Namespace(ALL_USERS_DESKTOP)
Set FolderItem = Folder.Self
AllUDesk = FolderItem.Path
Set Link = Act.CreateShortcut(AllUDesk & "\My ShortCut Link.lnk")
'/-> Place A Full Path In The Link.TargetPath EG Link.TargetPath = HD:\Folder\ItemName.exe
Link.TargetPath = "Notepad.exe"
Link.WindowStyle = 1
Link.Hotkey = "CTRL+SHIFT+F"
'/-> Icon Location, EG Link.IconLocation = "notepad.exe, 0", EG Link.IconLocation = "HD:\Folder\ItemName.exe, 0"
Link.IconLocation = "shell32.dll, 200"
Link.Description = "Pop Up Details Here"
Link.WorkingDirectory = AllUDesk
Link.Save

If you wanted this to run showing a cmd window

Save As Comspec_SCAllUDesk.vbs

 Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Act :Set Act = CreateObject("Wscript.Shell")
Dim Ts, Vbs, V1
Vbs = Act.ExpandEnvironmentStrings("%SystemDrive%\SCAllUDesk.vbs")
Set Ts = Fso.CreateTextFile(Vbs)
Ts.WriteLine " Const ALL_USERS_DESKTOP = &H19&"
Ts.WriteLine " Dim Shell :Set Shell = CreateObject(""Shell.Application"")"
Ts.WriteLine " Dim Act :Set Act = CreateObject(""Wscript.Shell"")"
Ts.WriteLine " Dim AllUDesk, Folder, FolderItem, Link, V1"
Ts.WriteLine " Set Folder = Shell.Namespace(ALL_USERS_DESKTOP)"
Ts.WriteLine " Set FolderItem = Folder.Self"
Ts.WriteLine " V1 = Space(2) & Chr(187) & Chr(160)"
Ts.WriteLine " AllUDesk = FolderItem.Path"
Ts.WriteLine " Wscript.Echo V1 & ""Preparing To Add The ShortCut Link"" "
Ts.WriteLine " Wscript.Sleep 2000"
Ts.WriteLine " Set Link = Act.CreateShortcut(AllUDesk & ""\My ShortCut Link.lnk"")"
Ts.WriteLine "'/-> Place A Full Path In The Link.TargetPath EG Link.TargetPath = HD:\Folder\ItemName.exe"
Ts.WriteLine " Link.TargetPath = ""Notepad.exe"""
Ts.WriteLine " Link.WindowStyle = 1"
Ts.WriteLine " Link.Hotkey = ""CTRL+SHIFT+F"""
Ts.WriteLine "'/-> Icon Location, EG Link.IconLocation = ""notepad.exe, 0"", EG Link.IconLocation = ""HD:\Folder\ItemName.exe, 0"""
Ts.WriteLine " Link.IconLocation = ""shell32.dll, 200"""
Ts.WriteLine " Link.Description = ""Pop Up Details Here"""
Ts.WriteLine " Link.WorkingDirectory = AllUDesk"
Ts.WriteLine " Link.Save"
Ts.WriteLine " Wscript.Echo "
Ts.WriteLine " Wscript.Echo V1 & ""Completed Adding The ShortCut Link"" "
Ts.WriteLine " Wscript.Sleep 3000"
Ts.Close
Set V1 = Fso.GetFile(Vbs)
Act.Run("%Comspec% /c @Echo Off && Color 9E && Title ShortCut Link " &_
"&& cscript.exe " & Chr(34) & V1.Path & chr(34)),1,True
V1.Delete()

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...