Skip to content

Commit

Permalink
Merge pull request #38 from AceCentre/buildGridset
Browse files Browse the repository at this point in the history
Build gridset
  • Loading branch information
willwade authored Oct 25, 2023
2 parents ef33957 + 818a728 commit 9684c96
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions CreateGridset.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ def modify_gridset(gridset_path, LocalAppPath):
shutil.rmtree(temp_dir)
os.remove(gridset_path)

# Create a .bat file on the Desktop to act as a shortcut
# Create a shortcut file on the Desktop to act as a shortcut
desktop = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop')
bat_file = os.path.join(desktop, "Open Example AAC Helper Pages.bat")

with open(bat_file, 'w') as f:
f.write(f'start "" "{new_gridset_dir}"')
exit_code = os.system(f'powershell.exe $ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut("{desktop}"); $s.TargetPath = "{new_gridset_dir}"; $s.Save()')
if exit_code == 0:
#print("Shortcut successfully created.")
else:
#print("Failed to create shortcut.")

if __name__ == "__main__":
app_data_path = os.environ.get('APPDATA', '') # Changed to APPDATA
Expand Down

0 comments on commit 9684c96

Please sign in to comment.