getOutStreamFromSection delsub.ins

Antworten
bobzbobz
Beiträge: 169
Registriert: 30 Nov 2012, 10:41
Wohnort: Denmark

getOutStreamFromSection delsub.ins

Beitrag von bobzbobz »

Hi

I am trying to run a getOutStreamFromSection() inside of a delsub-script - is this not possible??

This works:
cleanup.ins

Code: Alles auswählen

[Actions]

DefVar $ProfilePath$
DefVar $UserProfileName$
DefStringList $UserProfileNamesList$

Set $UserProfileNamesList$ = getOutStreamFromSection ('DosInAnIcon_list_profiledir')
for %prof% in $UserProfileNamesList$ do Sub_check_user

[Sub_check_user]
Set $UserProfileName$ = "%prof%"
if not ($UserProfileName$ = "") and not ($UserProfileName$ = "All Users") and not ($UserProfileName$ = "Public") and not ($UserProfileName$ = "LocalService") and not ($UserProfileName$ = "NetworkService")
	if FileExists("%Systemdrive%\Users\%prof%\Desktop\OpenSuse.lnk")
		Files_uninstall
	endif
endif

[DosInAnIcon_list_profiledir]
@echo off
dir "%Systemdrive%\Users" /b /ad

[Files_uninstall]
del -sf "%Systemdrive%\Users\$UserProfileName$\Desktop\OpenSuse.lnk"
This does not work:
delsub.ins

Code: Alles auswählen

...
set $UserProfileNamesList$ = getOutStreamFromSection ('DosInAnIcon_list_profiledir')
for %prof% in $UserProfileNamesList$ do Sub_check_user
...
[DosInAnIcon_list_profiledir]
@echo off
dir "%Systemdrive%\Users" /b /ad

[Sub_check_user]
Set $UserProfileName$ = "%prof%"
if not ($UserProfileName$ = "") and not ($UserProfileName$ = "All Users") and not ($UserProfileName$ = "Public") and not ($UserProfileName$ = "LocalService") and not ($UserProfileName$ = "NetworkService")
	if FileExists("%Systemdrive%\Users\%prof%\Desktop\OpenSuse.lnk")
		Files_uninstall2
	endif
endif

[Files_uninstall2]
del -sf "%Systemdrive%\Users\$UserProfileName$\Desktop\OpenSuse.lnk"
If i run the delsub-script, I get an error "Section DosInAnIcon_list_profiledir cannot be found".

Regards,
Soren
Antworten