commit 39f176269a658a2636e2031b6f2be8ae68ed569a Author: Steven Hobs <47906512+stevenhobs@users.noreply.github.com> Date: Sat Aug 23 15:38:07 2025 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e3b88c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.lnk \ No newline at end of file diff --git a/CreateLinks.ps1 b/CreateLinks.ps1 new file mode 100644 index 0000000..919a415 --- /dev/null +++ b/CreateLinks.ps1 @@ -0,0 +1,71 @@ +# PowerShell script to create Chrome shortcuts for specific URLs + +# Define variables +$labelsFile = "labels.txt" +$faviconFile = "logo.ico" +$chromePath = "C:\Program Files\Google\Chrome\Application\chrome.exe" +$baseUrl = "https://seller.hepsiglobal.com/" +$baseUserDataDir = "D:\HepsiSeller-Data" + +# Check if Chrome executable exists +if (-not (Test-Path $chromePath)) { + Write-Error "Chrome executable not found: $chromePath" + exit 1 +} + +# Check if stores.txt file exists +if (-not (Test-Path $labelsFile)) { + Write-Error "stores.txt file not found: $labelsFile" + exit 1 +} + +# Check if favicon.ico file exists +if (-not (Test-Path $faviconFile)) { + Write-Error "favicon.ico file not found: $faviconFile" + exit 1 +} + +# Read store names +$stores = Get-Content $labelsFile + +# Create shortcuts for each store +foreach ($store in $stores) { + # Skip empty lines + if ([string]::IsNullOrWhiteSpace($store)) { + continue + } + + # Create user data directory path + $userDataDir = Join-Path $baseUserDataDir $store + + # Create user data directory if it doesn't exist + if (-not (Test-Path $userDataDir)) { + New-Item -ItemType Directory -Path $userDataDir -Force | Out-Null + } + + # Copy logo.ico to user data directory + $localFaviconPath = Join-Path $userDataDir "logo.ico" + if (Test-Path $faviconFile) { + Copy-Item -Path $faviconFile -Destination $localFaviconPath -Force + } + + # Create shortcut + $shortcutName = "$store.lnk" + $shortcutPath = Join-Path $PWD $shortcutName + + # Create WScript.Shell object + $shell = New-Object -ComObject WScript.Shell + + # Create shortcut object + $shortcut = $shell.CreateShortcut($shortcutPath) + + # Set shortcut properties + $shortcut.TargetPath = $chromePath + $shortcut.Arguments = "--user-data-dir=`"$userDataDir`" --app=`"$baseUrl`"" + $shortcut.IconLocation = "$localFaviconPath,0" + $shortcut.Save() + + Write-Output "Created shortcut: $shortcutName" +} + +Write-Output "All shortcuts created successfully." diff --git a/labels.txt b/labels.txt new file mode 100644 index 0000000..5232db3 --- /dev/null +++ b/labels.txt @@ -0,0 +1,3 @@ +test_1 +test_2 +test_3 \ No newline at end of file diff --git a/logo.ico b/logo.ico new file mode 100644 index 0000000..1134f32 Binary files /dev/null and b/logo.ico differ