Jump to content


Photo

[Tutorial] Exotic INF ProfileItems/Shortcuts


  • Please log in to reply
72 replies to this topic

#21 DaRk MaDnEsS

DaRk MaDnEsS

    Live Free or Die Hard

  • Contributors
  • 971 posts
  • Location:Some where out computer
  • OS:Windows 7

Posted 07 October 2009 - 04:54 PM

well try
[DelStartMenuFolderEx]
Name        = %AppLink%,0x00000002
SubDir          = %App_StartMenuFolder%

if i wasn't mistaken

you think about it

i tell you delete a file

?? you need to know it's place

that why you will need the subdir

the other advantage in using the A

is 0x0000000A,22 << that the 22 says the file place

so if i wasn't mistaken you wouldn't need the subdir

test and tell

#22 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,825 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 07 October 2009 - 06:14 PM

0x00000008,22 = %AllUserProfile%\Start Menu

(just switch "8" to "A" and it deletes the shortcut)

Yes you can also try/use either 0x00000002 or 0x00000003 to delete the shortcut.
You have to also take in mind when you run your script...remember this shortcut does not actually get created until syssetup.inf is executed, which happens somewhere around or before t13

Test your shortcut removal code on right now on your actual pc, if it works fine but not during setup then you should look at when you are executing it during the install

@egorz if you know a way to use CMD.EXE or some other tool I could maybe try to launch it with .INF but no, dont know how to do that

#23 Cum zicea poetul

Cum zicea poetul

    Lurker

  • Members
  • Pip
  • 3 posts
  • OS:Windows XP Pro

Posted 08 October 2009 - 01:58 PM

Thank you for the quick feedback. I've tried multiple approaches and the behaviour is the same - the shortcut is not removed.

Specifically, I tried the following:
  • with and without SubDir = %App_StartMenuFolder%
  • with "0x00000002", "0x00000003" and with "0x0000000A,22"

I am surprised that none of them work, because the documentation says they should, and your experience is also suggesting that deleting shortcuts this way must work.

remember this shortcut does not actually get created until syssetup.inf is executed, which happens somewhere around or before t13

I am thinking that in my case the problem is in the fact that the procedure is not invoked at the right time.

I also guessed it could have some thing to do with administrative privileges (or lack of them), but the results are the same even if I use "run as administrator".



What other ideas you think I could test?

#24 DaRk MaDnEsS

DaRk MaDnEsS

    Live Free or Die Hard

  • Contributors
  • 971 posts
  • Location:Some where out computer
  • OS:Windows 7

Posted 08 October 2009 - 02:09 PM

Thank you for the quick feedback. I've tried multiple approaches and the behaviour is the same - the shortcut is not removed.

Specifically, I tried the following:

  • with and without SubDir = %App_StartMenuFolder%
  • with "0x00000002", "0x00000003" and with "0x0000000A,22"

I am surprised that none of them work, because the documentation says they should, and your experience is also suggesting that deleting shortcuts this way must work.


I am thinking that in my case the problem is in the fact that the procedure is not invoked at the right time.

I also guessed it could have some thing to do with administrative privileges (or lack of them), but the results are the same even if I use "run as administrator".



What other ideas you think I could test?


try to change the 22

it's the file path

if %App_StartMenuFolder% mean

0x00000008,2 = %UserProfile%\Start Menu\Programs

then the command should be

0x0000000A,2

to delete

#25 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,825 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 08 October 2009 - 04:04 PM

Could you remove the %Strings% stuff and use the correct shortcut names, I will put together all 3 profileitems delete examples

If you can post your entire INF file

#26 Cum zicea poetul

Cum zicea poetul

    Lurker

  • Members
  • Pip
  • 3 posts
  • OS:Windows XP Pro

Posted 15 October 2009 - 05:39 PM

Here is the body of the INF file, I included the section with the strings, so you can see where everything is taken from.

[Version]
Signature    = $Windows NT$

[DefaultInstall]
;UpdateInis=CreateStartMenuFolder
AddReg             = RegAddUninst
ProfileItems    = AddTest, AddTestEx

[DefaultUnInstall]
ProfileItems=AddTest.DelShortcut

[AddTest.DelShortcut]
Name =ACME distorterA,0x0000000A, 2
;Also tried with Name =%Soft_Name%,0x0000000A, 2
;SubDir =Sub Directory


[RegAddUninst]
HKLM,%SMWCV%\Uninstall\%Soft_Name%,DisplayName,,"ACME"
HKLM,%SMWCV%\Uninstall\%Soft_Name%,UninstallString,,"RunDll32 advpack.dll,LaunchINFSection d:\test\installer\installer.inf, DefaultUninstall"


;16422 = program files
[AddTest]
Name        = ACME distorterA 
SubDir        = %Provider%
Infotip        = "This is a tooltip weeha!"
CmdLine        = -1, %App_ProgramFolder%, Acmedist.exe    
WorkingDir    = -1, %App_ProgramFolder%



[AddTestEx]
Name        = %Soft_Name%
SubDir        = %Provider%
Infotip        = "This is a tooltip weeha!QQQQQQ"
CmdLine        = -1, %App_ProgramFolder%, Acmedist.exe    
WorkingDir    = -1, %App_ProgramFolder%


[Strings]
SMWCV="Software\Microsoft\Windows\CurrentVersion"
Provider="ACME"
Soft_Name="ACME distorter 5.0"
AppLink="ACME distorter 5.0"
App_Name="ACME distorter 5.0"
App_StartMenuFolder="ACME\Distorter 5.0"
App_ProgramFolder="ACME\Distorter 5.0"
ShortCutFileName="ACME\Distorter 5.0.lnk"
PathAndFileName="ACMEdist.exe"
Arguments= ""

I tried using "0x0000000A,2", as suggested by DaRk MaDnEsS, but the result is the same - the shortcut continues to stay in the Start menu.

Edited by Cum zicea poetul, 15 October 2009 - 05:42 PM.


#27 DaRk MaDnEsS

DaRk MaDnEsS

    Live Free or Die Hard

  • Contributors
  • 971 posts
  • Location:Some where out computer
  • OS:Windows 7

Posted 15 October 2009 - 05:48 PM

Here is the body of the INF file, I included the section with the strings, so you can see where everything is taken from.

[Version]
Signature    = $Windows NT$

[DefaultInstall]
;UpdateInis=CreateStartMenuFolder
AddReg             = RegAddUninst
ProfileItems    = AddTest, AddTestEx

[DefaultUnInstall]
ProfileItems=AddTest.DelShortcut

[AddTest.DelShortcut]
Name =ACME distorterA,0x0000000A, 2
;Also tried with Name =%Soft_Name%,0x0000000A, 2
;SubDir =Sub Directory


[RegAddUninst]
HKLM,%SMWCV%\Uninstall\%Soft_Name%,DisplayName,,"ACME"
HKLM,%SMWCV%\Uninstall\%Soft_Name%,UninstallString,,"RunDll32 advpack.dll,LaunchINFSection d:\test\installer\installer.inf, DefaultUninstall"


;16422 = program files
[AddTest]
Name        = ACME distorterA 
SubDir        = %Provider%
Infotip        = "This is a tooltip weeha!"
CmdLine        = -1, %App_ProgramFolder%, Acmedist.exe    
WorkingDir    = -1, %App_ProgramFolder%



[AddTestEx]
Name        = %Soft_Name%
SubDir        = %Provider%
Infotip        = "This is a tooltip weeha!QQQQQQ"
CmdLine        = -1, %App_ProgramFolder%, Acmedist.exe    
WorkingDir    = -1, %App_ProgramFolder%


[Strings]
SMWCV="Software\Microsoft\Windows\CurrentVersion"
Provider="ACME"
Soft_Name="ACME distorter 5.0"
AppLink="ACME distorter 5.0"
App_Name="ACME distorter 5.0"
App_StartMenuFolder="ACME\Distorter 5.0"
App_ProgramFolder="ACME\Distorter 5.0"
ShortCutFileName="ACME\Distorter 5.0.lnk"
PathAndFileName="ACMEdist.exe"
Arguments= ""

I tried using "0x0000000A,2", as suggested by DaRk MaDnEsS, but the result is the same - the shortcut continues to stay in the Start menu.


well what i think it should work

[AddTest.DelShortcut]
Name =%Soft_Name%,0x0000000A, 2
SubDir = %Provider%

and the shortcut should be 

[AddTestEx]
Name        = %Soft_Name%,0x00000008,2
SubDir        = %Provider%
Infotip        = "This is a tooltip weeha!QQQQQQ"
CmdLine        = -1, %App_ProgramFolder%, Acmedist.exe    
WorkingDir    = -1, %App_ProgramFolder%

test and tell me

Edit:

i think since it installs to all users

you might need to use 0x0000000A, 23

with the old inf ( i'm not sure tho i just got this in my head)

Edited by DaRk MaDnEsS, 15 October 2009 - 05:53 PM.


#28 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,825 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 15 October 2009 - 07:31 PM

[Adds]
Name=%Soft_Name%,0x00000008,2
SubDir=%Provider%
Infotip="This is a tooltip weeha!QQQQQQ"
CmdLine=-1,%App_ProgramFolder%,Acmedist.exe    
WorkingDir=-1,%App_ProgramFolder%

[Deletes]
Name=%Soft_Name%,0x0000000A,2
SubDir=%Provider%

BTW you dont need to use any exotic inf profileitem flags for this shortcut, you can use 0x00000001 then 0x00000002 or 0x00000003 to delete it (OH an it does not install to all users its going into current user)

[Adds]
Name=%Soft_Name%,0x00000001
SubDir=%Provider%
Infotip="This is a tooltip weeha!QQQQQQ"
CmdLine=-1,%App_ProgramFolder%,Acmedist.exe    
WorkingDir=-1,%App_ProgramFolder%

[Deletes1]
Name=%Soft_Name%,0x00000002
SubDir=%Provider%

[Deletes2]
Name=%Soft_Name%,0x00000003
SubDir=%Provider%


#29 Alpha_95

Alpha_95

    WinCert Friend

  • Members
  • PipPipPipPip
  • 170 posts
  • OS:non-selected

Posted 16 October 2009 - 10:46 AM

How to use the flag "CE_COPYFLG_NO_DATE_DIALOG 0x20000000" which does not copy a file if the target file is newer.

#30 DaRk MaDnEsS

DaRk MaDnEsS

    Live Free or Die Hard

  • Contributors
  • 971 posts
  • Location:Some where out computer
  • OS:Windows 7

Posted 16 October 2009 - 11:16 AM

How to use the flag "CE_COPYFLG_NO_DATE_DIALOG 0x20000000" which does not copy a file if the target file is newer.


in the copy section

lets say that you are copying DM.exe

DM.exe,,0x20000000


should do the trick

#31 Alpha_95

Alpha_95

    WinCert Friend

  • Members
  • PipPipPipPip
  • 170 posts
  • OS:non-selected

Posted 16 October 2009 - 11:18 AM

ok thank you but I FGCBA reports errors by as follows :s

Edited by Alpha_95, 16 October 2009 - 11:19 AM.


#32 DaRk MaDnEsS

DaRk MaDnEsS

    Live Free or Die Hard

  • Contributors
  • 971 posts
  • Location:Some where out computer
  • OS:Windows 7

Posted 16 October 2009 - 11:24 AM

ok thank you but I FGCBA reports errors by as follows :s


sorry my bad

i miss writien it

DM.exe,,,0x20000000

it should be 3 ,,, not only 2

If FGCBA Reports any error

try to test it and see

#33 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,825 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 16 October 2009 - 09:47 PM

Ignore the error, FGCBA does not support copy file flags

#34 Alpha_95

Alpha_95

    WinCert Friend

  • Members
  • PipPipPipPip
  • 170 posts
  • OS:non-selected

Posted 17 October 2009 - 10:57 AM

thanks, it's perfect !

edit: No, addon dosen't work with this flag...

Edited by Alpha_95, 20 October 2009 - 10:21 AM.


#35 Alpha_95

Alpha_95

    WinCert Friend

  • Members
  • PipPipPipPip
  • 170 posts
  • OS:non-selected

Posted 19 October 2009 - 09:12 AM

There is possible to add a scheduled task?

#36 Alpha_95

Alpha_95

    WinCert Friend

  • Members
  • PipPipPipPip
  • 170 posts
  • OS:non-selected

Posted 20 October 2009 - 08:26 AM

I have an InstallShield (% ProgramFiles%\InstallShield Installation Information\(8F5A0981-5CDC-41D0-BCA2-AD3B777FC358)\), how to make a follow Inf?

Thank you

#37 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,825 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 20 October 2009 - 06:34 PM

No comprende :S

#38 Alpha_95

Alpha_95

    WinCert Friend

  • Members
  • PipPipPipPip
  • 170 posts
  • OS:non-selected

Posted 20 October 2009 - 06:38 PM

my program .exe is an Installshield installer that creates files in "%ProgramFiles%\InstallShield Installation Information\(8F5A0981-5CDC-41D0-BCA2-AD3B777FC358)\" so I love creating knowledge in INF installer?

#39 DaRk MaDnEsS

DaRk MaDnEsS

    Live Free or Die Hard

  • Contributors
  • 971 posts
  • Location:Some where out computer
  • OS:Windows 7

Posted 20 October 2009 - 06:49 PM

my program .exe is an Installshield installer that creates files in "%ProgramFiles%\InstallShield Installation Information\(8F5A0981-5CDC-41D0-BCA2-AD3B777FC358)\" so I love creating knowledge in INF installer?


you mean you want to make an inf that installs fies to there

or .. ?

cause i don't understand

#40 Alpha_95

Alpha_95

    WinCert Friend

  • Members
  • PipPipPipPip
  • 170 posts
  • OS:non-selected

Posted 21 October 2009 - 03:20 AM

yes I want to make a INF that installs the application (.exe) installshield...


you understand French?
otherwise I ask you in French by private message because my English is very bad ..




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users